﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_HoaDonChiNhanh : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvGiaoNhan")]
        private ADVObjects _AdvGiaoNhan;
        [AccessedThroughProperty("AdvNhanVien")]
        private ADVObjects _AdvNhanVien;
        [AccessedThroughProperty("AdvTaiKhoanChu")]
        private ADVAccount _AdvTaiKhoanChu;
        [AccessedThroughProperty("AdvTaiKhoanThue")]
        private ADVAccount _AdvTaiKhoanThue;
        [AccessedThroughProperty("AdvTKChietKhau")]
        private ADVAccount _AdvTKChietKhau;
        [AccessedThroughProperty("AdvTKDoanhThu")]
        private ADVAccount _AdvTKDoanhThu;
        [AccessedThroughProperty("Button2")]
        private Button _Button2;
        [AccessedThroughProperty("CboChiNhanh")]
        private ComboBox _CboChiNhanh;
        [AccessedThroughProperty("CboKhoHang")]
        private ComboBox _CboKhoHang;
        [AccessedThroughProperty("CboLoaiGia")]
        private ComboBox _CboLoaiGia;
        [AccessedThroughProperty("CboLoaiHoaDon")]
        private ComboBox _CboLoaiHoaDon;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CKChietKhauTheoHD")]
        private CheckBox _CKChietKhauTheoHD;
        [AccessedThroughProperty("CKHienThiHoaDon")]
        private CheckBox _CKHienThiHoaDon;
        [AccessedThroughProperty("CKTachThue")]
        private CheckBox _CKTachThue;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdCongNo")]
        private ToolStripButton _CmdCongNo;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdDTThue")]
        private Button _CmdDTThue;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdHoaHong")]
        private ToolStripButton _CmdHoaHong;
        [AccessedThroughProperty("cmdPhieuXuat")]
        private ToolStripMenuItem _cmdPhieuXuat;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripSplitButton _CmdPrint;
        [AccessedThroughProperty("cmdPrintVATMau")]
        private ToolStripMenuItem _cmdPrintVATMau;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("GroupBox1")]
        private GroupBox _GroupBox1;
        [AccessedThroughProperty("GroupBox2")]
        private GroupBox _GroupBox2;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label21")]
        private Label _Label21;
        [AccessedThroughProperty("Label22")]
        private Label _Label22;
        [AccessedThroughProperty("Label23")]
        private Label _Label23;
        [AccessedThroughProperty("Label24")]
        private Label _Label24;
        [AccessedThroughProperty("Label25")]
        private Label _Label25;
        [AccessedThroughProperty("Label26")]
        private Label _Label26;
        [AccessedThroughProperty("Label27")]
        private Label _Label27;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label30")]
        private Label _Label30;
        [AccessedThroughProperty("Label31")]
        private Label _Label31;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("mnBaoGia")]
        private ToolStripMenuItem _mnBaoGia;
        [AccessedThroughProperty("mnChungTuGoc")]
        private ContextMenuStrip _mnChungTuGoc;
        [AccessedThroughProperty("mnDonHang")]
        private ToolStripMenuItem _mnDonHang;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("TabControl1")]
        private TabControl _TabControl1;
        [AccessedThroughProperty("TabControl2")]
        private TabControl _TabControl2;
        [AccessedThroughProperty("TabPage1")]
        private TabPage _TabPage1;
        [AccessedThroughProperty("TabPage2")]
        private TabPage _TabPage2;
        [AccessedThroughProperty("TabPage4")]
        private TabPage _TabPage4;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripButton2")]
        private ToolStripButton _ToolStripButton2;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("ToolStripSeparator4")]
        private ToolStripSeparator _ToolStripSeparator4;
        [AccessedThroughProperty("TxtChietKhau")]
        private C1NumericEdit _TxtChietKhau;
        [AccessedThroughProperty("TxtChietKhauNT")]
        private C1NumericEdit _TxtChietKhauNT;
        [AccessedThroughProperty("TxtDiaChiThue")]
        private TextBox _TxtDiaChiThue;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtGioiHanNo")]
        private C1NumericEdit _TxtGioiHanNo;
        [AccessedThroughProperty("TxtMaSoThue")]
        private TextBox _TxtMaSoThue;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayHoaDon")]
        private DateTimePicker _TxtNgayHoaDon;
        [AccessedThroughProperty("TxtNgayToiHanThanhToan")]
        private DateTimePicker _TxtNgayToiHanThanhToan;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoDuNo")]
        private C1NumericEdit _TxtSoDuNo;
        [AccessedThroughProperty("TxtSoHoaDon")]
        private TextBox _TxtSoHoaDon;
        [AccessedThroughProperty("TxtSoNgayThanhToan")]
        private C1NumericEdit _TxtSoNgayThanhToan;
        [AccessedThroughProperty("TxtSoSeri")]
        private TextBox _TxtSoSeri;
        [AccessedThroughProperty("TxtTenDoiTuongThue")]
        private TextBox _TxtTenDoiTuongThue;
        [AccessedThroughProperty("TxtThueSuat")]
        private C1NumericEdit _TxtThueSuat;
        [AccessedThroughProperty("TxtTienHang")]
        private C1NumericEdit _TxtTienHang;
        [AccessedThroughProperty("TxtTienHangNT")]
        private C1NumericEdit _TxtTienHangNT;
        [AccessedThroughProperty("TxtTienThue")]
        private C1NumericEdit _TxtTienThue;
        [AccessedThroughProperty("TxtTienThueNT")]
        private C1NumericEdit _TxtTienThueNT;
        [AccessedThroughProperty("TxtTinhThue")]
        private DateTimePicker _TxtTinhThue;
        [AccessedThroughProperty("TxtTongThanhToan")]
        private C1NumericEdit _TxtTongThanhToan;
        [AccessedThroughProperty("TxtTongThanhToanNT")]
        private C1NumericEdit _TxtTongThanhToanNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("TxtTyLeChietKhau")]
        private C1NumericEdit _TxtTyLeChietKhau;
        [AccessedThroughProperty("VSDichVu")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSDichVu;
        [AccessedThroughProperty("VSHangHoa")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSHangHoa;
        private string cFrmFormat;
        private int cFrmGhiSo;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsDMDonViTinh objDVT;
        private clsXuatKho objHD;
        private clsHoaDonChiTietDichVu objHDDV;
        private clsXuatKhoChiTiet objHDHH;
        private clsDMHangHoa objHH;
        private clsDMLoaiHoaDon objLHD;
        private clsDMLoaiTien ObjLT;
        private clsSoChungTu objSoCT;
        private DataTable pdt;

        public Frm_HoaDonChiNhanh()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_XuatBan_KeyDown);
            base.Load += new EventHandler(this.Frm_XuatBan_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "XBCN";
            this.objSoCT = new clsSoChungTu();
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.objHH = new clsDMHangHoa();
            this.objDVT = new clsDMDonViTinh();
            this.objHD = new clsXuatKho();
            this.objHDHH = new clsXuatKhoChiTiet();
            this.objHDDV = new clsHoaDonChiTietDichVu();
            this.objLHD = new clsDMLoaiHoaDon();
            this.cFrmGhiSo = 0;
            this.ObjLT = new clsDMLoaiTien();
            this.InitializeComponent();
        }

        private void AdvKhachHang_Load(object sender, EventArgs e)
        {
        }

        private void AdvKhachHang_ValueChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboChiNhanh.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString() != "")
            {
                clsDMDoiTuong tuong = new clsDMDoiTuong();
                tuong.Load(Conversions.ToString(this.CboChiNhanh.SelectedValue));
                this.TxtSoNgayThanhToan.Value = tuong.HanThanhToan;
                this.TxtSoNgayThanhToan_LostFocus(RuntimeHelpers.GetObjectValue(sender), e);
                this.AdvNhanVien.Value = tuong.KhoaNhanVienQuanLy;
                if (modGeneral.H_LANGUAGE == "VIET")
                {
                    this.TxtTenDoiTuongThue.Text = tuong.TenViet.Trim();
                }
                else
                {
                    this.TxtTenDoiTuongThue.Text = tuong.TenAnh.Trim();
                }
                this.TxtDiaChiThue.Text = tuong.DiaChi;
                this.TxtMaSoThue.Text = tuong.MaSoThue;
                if (tuong.KhoaLoaiGia.Trim() != "")
                {
                    this.CboLoaiGia.SelectedValue = tuong.KhoaLoaiGia;
                }
                else
                {
                    this.CboLoaiGia.SelectedValue = modGeneral.H_GIACHUAN;
                }
                this.LoadCongNo();
                if (modGeneral.H_LANGUAGE == "VIET")
                {
                    this.TxtDienGiai.Text = modGeneral.Tranlated("Xuất b\x00e1n cho", "") + " " + tuong.TenViet.Trim();
                }
                else
                {
                    this.TxtDienGiai.Text = modGeneral.Tranlated("Xuất b\x00e1n cho", "") + " " + tuong.TenAnh.Trim();
                }
                this.TxtDienGiai.Text = this.TxtDienGiai.Text.Trim() + " " + modGeneral.Tranlated("HĐ số:", "") + this.TxtSoHoaDon.Text.Trim();
            }
        }

        private void Button2_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_TruyVanCongNoPhaiThu.cFrmKhoaDoiTuong = Conversions.ToString(this.CboChiNhanh.SelectedValue);
            MyProject.Forms.Frm_TruyVanCongNoPhaiThu.cFrmKhoaTaiKhoan = this.AdvTaiKhoanChu.Value;
            MyProject.Forms.Frm_TruyVanCongNoPhaiThu.cFrmNamThang = LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6);
            MyProject.Forms.Frm_TruyVanCongNoPhaiThu.ShowDialog();
        }

        private void Button3_Click(object sender, EventArgs e)
        {
            string str;
            string expression = "";
            if (this.mEnabledControl)
            {
                str = "";
            }
            else
            {
                str = "VIEW";
            }
            expression = Conversions.ToString(SearchModule.SearchDoiTuongThue(this.TxtTenDoiTuongThue.Text, this.TxtMaSoThue.Text, this.TxtDiaChiThue.Text, str));
            if (expression != "")
            {
                object instance = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                this.TxtTenDoiTuongThue.Text = Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                this.TxtMaSoThue.Text = Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
                this.TxtDiaChiThue.Text = Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 2 }, null));
            }
        }

        private void CboLoaiHoaDon_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.mEnabledControl && (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != ""))
            {
                clsDMLoaiHoaDon don = new clsDMLoaiHoaDon();
                don.Load(Conversions.ToString(this.CboLoaiHoaDon.SelectedValue));
                this.TxtThueSuat.Value = don.TyLeThue;
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
                if (strCode != "")
                {
                    this.ObjLT.LoadByCode(strCode);
                    if (this.ObjLT.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("0000000000", this.ObjLT.SoLe);
                    }
                    if (this.ObjLT.TienViet == 1)
                    {
                        this.txtTyGia.Enabled = false;
                    }
                    else
                    {
                        this.txtTyGia.Enabled = true;
                    }
                    this.txtTyGia.Value = this.ObjLT.TyGia;
                    this.txtTyGia_LostFocus(this.txtTyGia, e);
                    this.FormatNumber();
                }
            }
        }

        public bool CheckGrid()
        {
            if ((this.VSHangHoa.Rows.Count == 1) & (this.VSDichVu.Rows.Count == 1))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập h\x00e0ng h\x00f3a, dịch vụ cần b\x00e1n!", ""));
                this.CmdAddRow.Focus();
                return false;
            }
            int num2 = this.VSHangHoa.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x19]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.objHH.Load(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (this.objHH.KhoaTKHangHoa.Trim() == "")
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Bạn chưa định nghĩa t\x00e0i khoản h\x00e0ng h\x00f3a cho mặt h\x00e0ng", "") + ":" + LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 5]), "", modGeneral.TypeOfValue.Nothing).ToString());
                        return false;
                    }
                    this.VSHangHoa[i, 0x18] = this.objHH.KhoaTKHangHoa;
                }
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x1b]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.objHH.Load(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (this.objHH.KhoaTKGiaVon.Trim() == "")
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Bạn chưa định nghĩa t\x00e0i khoản gi\x00e1 vốn cho mặt h\x00e0ng", "") + ":" + LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 5]), "", modGeneral.TypeOfValue.Nothing).ToString());
                        return false;
                    }
                    this.VSHangHoa[i, 0x1a] = this.objHH.KhoaTKGiaVon;
                }
            }
            return true;
        }

        public bool CheckIvalid()
        {
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objHD.IsDuplicateVoucherNo(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn phải nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objHD.IsDuplicateVoucherNo(this.TxtSoChungTu.Text, this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn h\x00e3y nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboChiNhanh.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập kh\x00e1ch h\x00e0ng mua h\x00e0ng!", ""));
                this.CboChiNhanh.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập tỷ gi\x00e1 nguy\x00ean tệ!", ""));
                this.txtTyGia.Focus();
                return false;
            }
            if (modGeneral.H_GHISODONGTHOI)
            {
                if (LVYModule.ReturnIfNull(this.AdvTaiKhoanChu.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số t\x00e0i khoản thanh to\x00e1n!", ""));
                    this.AdvTaiKhoanChu.Focus();
                    return false;
                }
                if (LVYModule.ReturnIfNull(this.AdvTaiKhoanThue.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số t\x00e0i khoản thuế VAT!", ""));
                    this.AdvTaiKhoanThue.Focus();
                    return false;
                }
                if (LVYModule.ReturnIfNull(this.AdvTKDoanhThu.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số t\x00e0i khoản doanh thu!", ""));
                    this.AdvTKDoanhThu.Focus();
                    return false;
                }
                if (LVYModule.ReturnIfNull(this.AdvTKChietKhau.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số t\x00e0i khoản chiết khấu!", ""));
                    this.AdvTKChietKhau.Focus();
                    return false;
                }
            }
            if (!this.CheckGrid())
            {
                return false;
            }
            return true;
        }

        private void CKChietKhauTheoHD_CheckedChanged(object sender, EventArgs e)
        {
            if (this.CKChietKhauTheoHD.CheckState == CheckState.Checked)
            {
                if (this.mEnabledControl)
                {
                    int num2 = this.VSHangHoa.Rows.Count - 1;
                    for (int i = 1; i <= num2; i++)
                    {
                        this.VSHangHoa[i, 0x12] = 0;
                        this.VSHangHoa[i, 0x13] = 0;
                        this.VSHangHoa[i, 0x16] = 0;
                        this.VSHangHoa[i, 0x17] = 0;
                    }
                }
                this.TxtTyLeChietKhau.ReadOnly = !this.mEnabledControl;
                this.TxtThueSuat.ReadOnly = !this.mEnabledControl;
                this.TxtChietKhauNT.ReadOnly = !this.mEnabledControl;
                this.TxtTienThueNT.ReadOnly = !this.mEnabledControl;
                this.TxtSoHoaDon.ReadOnly = false;
                this.CboLoaiHoaDon.Enabled = true;
                this.CKHienThiHoaDon.CheckState = CheckState.Unchecked;
                this.CKHienThiHoaDon.Enabled = false;
                this.TxtNgayHoaDon.Enabled = true;
            }
            else
            {
                this.TxtTyLeChietKhau.ReadOnly = true;
                this.TxtThueSuat.ReadOnly = true;
                this.TxtChietKhauNT.ReadOnly = true;
                this.TxtTienThueNT.ReadOnly = true;
                this.TxtSoHoaDon.ReadOnly = true;
                this.CboLoaiHoaDon.Enabled = false;
                this.CKHienThiHoaDon.Enabled = true;
                this.TxtNgayHoaDon.Enabled = false;
            }
        }

        private void CKHienThiHoaDon_CheckedChanged(object sender, EventArgs e)
        {
            this.VSHangHoa.Cols[2].Visible = this.CKHienThiHoaDon.CheckState > CheckState.Unchecked;
            this.VSHangHoa.Cols[3].Visible = this.CKHienThiHoaDon.CheckState > CheckState.Unchecked;
            this.VSHangHoa.Cols[0x15].Visible = this.CKHienThiHoaDon.CheckState > CheckState.Unchecked;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("ST_XuatKho", 15, "XB");
            this.CboLoaiTien.SelectedValue = LVYModule.ReturnIfNull(modGeneral.H_CURRENCY, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            this.EnabledControl = true;
            this.TxtNgayChungTu.Focus();
            this.InitDefault();
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboChiNhanh.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn chi nh\x00e1nh trước!", ""));
                this.CboChiNhanh.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboKhoHang.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn kho xuất h\x00e0ng b\x00e1n!", ""));
                this.CboKhoHang.Focus();
            }
            else
            {
                if (this.TabControl2.SelectedIndex == 0)
                {
                    int num3;
                    if (this.VSHangHoa.Rows.Count > 1)
                    {
                        int num2 = this.VSHangHoa.Rows.Count - 1;
                        if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[num2, 4]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                        {
                            return;
                        }
                    }
                    C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                    vSHangHoa.AddItem("");
                    int num = 12;
                    do
                    {
                        if ((num != 20) & (num != 0x15))
                        {
                            vSHangHoa[vSHangHoa.Rows.Count - 1, num] = 0;
                        }
                        num++;
                        num3 = 0x17;
                    }
                    while (num <= num3);
                    if (vSHangHoa.Rows.Count > 2)
                    {
                        vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(vSHangHoa[vSHangHoa.Rows.Count - 2, 1]);
                        vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(vSHangHoa[vSHangHoa.Rows.Count - 2, 2]);
                        vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(vSHangHoa[vSHangHoa.Rows.Count - 2, 3]);
                    }
                    vSHangHoa.Select(this.VSHangHoa.Rows.Count - 1, 2);
                    vSHangHoa.Focus();
                    if (!modGeneral.H_GIABANBAOGOMTHUE)
                    {
                        vSHangHoa[vSHangHoa.Rows.Count - 1, 20] = RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value);
                    }
                    vSHangHoa = null;
                    RowColEventArgs args = new RowColEventArgs(this.VSHangHoa.Rows.Count - 1, 5);
                    this.VSHangHoa_AfterEdit(this, args);
                }
                else
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSDichVu = this.VSDichVu;
                    this.VSDichVu.AddItem("");
                    this.VSDichVu.Select(this.VSHangHoa.Rows.Count - 1, 2);
                    this.VSDichVu.Focus();
                    vSDichVu = null;
                }
                if (this.VSHangHoa.Rows.Count > 1)
                {
                    this.CboKhoHang.Enabled = false;
                }
                else
                {
                    this.CboKhoHang.Enabled = true;
                }
            }
        }

        private void CmdCongNo_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_TruyVanCongNoPhaiThu.cFrmKhoaDoiTuong = Conversions.ToString(this.CboChiNhanh.SelectedValue);
            MyProject.Forms.Frm_TruyVanCongNoPhaiThu.cFrmKhoaTaiKhoan = this.AdvTaiKhoanChu.Value;
            MyProject.Forms.Frm_TruyVanCongNoPhaiThu.cFrmNamThang = LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6);
            MyProject.Forms.Frm_TruyVanCongNoPhaiThu.ShowDialog();
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.objHD.Load(this.cFrmKhoa);
                if (this.objHD.DaThanhToan > 0.0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("H\x00f3a đơn đ\x00e3 được thanh to\x00e1n. Bạn kh\x00f4ng thể sửa!", ""));
                }
                else if (LVYModule.ConfirmDelete("") && this.objHD.DeleteData(this.cFrmKhoa, 1))
                {
                    this.EmptyData();
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdDelRow_Click(object sender, EventArgs e)
        {
            if (this.VSHangHoa.Rows.Count != 1)
            {
                this.VSHangHoa.RemoveItem(this.VSHangHoa.Row);
                if (this.VSHangHoa.Rows.Count > 1)
                {
                    this.CboKhoHang.Enabled = false;
                }
                else
                {
                    this.CboKhoHang.Enabled = true;
                }
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.objHD.Load(this.cFrmKhoa);
                this.cFrmKhoaOld = this.cFrmKhoa;
                this.EnabledControl = true;
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_HoaDonChiNhanhList.Show();
            MyProject.Forms.Frm_HoaDonChiNhanhList.BringToFront();
        }

        private void CmdHoaHong_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_TinhHoaHong.cFrmKhoaHoaDon = this.cFrmKhoa;
            MyProject.Forms.Frm_TinhHoaHong.ShowDialog();
        }

        private void cmdPhieuXuat_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintHoaDon(this.cFrmKhoa);
            }
        }

        private void CmdPrint_ButtonClick(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintHoaDon(this.cFrmKhoa);
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
        }

        private void cmdPrintVATMau_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() == "")
            {
            }
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveHHDetailsTemp())
                {
                    this.objHD.ClearTemp(this.cFrmKhoa);
                }
                else if (!this.SaveDVDetailsTemp())
                {
                    this.objHD.ClearTemp(this.cFrmKhoa);
                }
                else if (Conversions.ToBoolean(Microsoft.VisualBasic.CompilerServices.Operators.NotObject(this.UpdateData())))
                {
                    this.objHD.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objHD.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            this.EnabledControl = false;
            if (LVYModule.ReturnIfNull(this.cFrmKhoaOld, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtSoChungTu.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 0;
            this.TxtDienGiai.Text = "";
            this.AdvNhanVien.Value = "";
            this.CboLoaiHoaDon.SelectedValue = "";
            this.TxtSoSeri.Text = "";
            this.TxtSoHoaDon.Text = "";
            this.AdvTaiKhoanChu.Value = "";
            this.AdvTaiKhoanThue.Value = "";
            this.CboChiNhanh.SelectedValue = "";
            this.VSHangHoa.Select(0, 0);
            this.VSHangHoa.Rows.Count = 1;
            this.VSDichVu.Select(0, 0);
            this.VSDichVu.Rows.Count = 1;
            this.CboLoaiGia.SelectedValue = "";
            this.TxtTienHang.Value = 0;
            this.TxtTienHangNT.Value = 0;
            this.TxtChietKhau.Value = 0;
            this.TxtChietKhauNT.Value = 0;
            this.TxtTienThue.Value = 0;
            this.TxtTienThueNT.Value = 0;
            this.TxtTongThanhToan.Value = 0;
            this.TxtTongThanhToanNT.Value = 0;
        }

        public void FormatNumber()
        {
            this.txtTyGia.FormatType = FormatTypeEnum.CustomFormat;
            this.txtTyGia.CustomFormat = this.cFrmFormat;
            this.TxtTienHangNT.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtTienHangNT.CustomFormat = this.cFrmFormat;
            this.TxtTienHang.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtTienHang.CustomFormat = modGeneral.H_FORMATNUMBER;
            this.TxtTienThueNT.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtTienThueNT.CustomFormat = this.cFrmFormat;
            this.TxtTienThue.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtTienThue.CustomFormat = modGeneral.H_FORMATNUMBER;
            this.TxtTongThanhToanNT.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtTongThanhToanNT.CustomFormat = this.cFrmFormat;
            this.TxtChietKhauNT.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtChietKhauNT.CustomFormat = this.cFrmFormat;
            this.TxtChietKhau.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtChietKhau.CustomFormat = modGeneral.H_FORMATNUMBER;
            this.TxtTongThanhToan.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtTongThanhToan.CustomFormat = modGeneral.H_FORMATNUMBER;
            this.TxtGioiHanNo.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtGioiHanNo.CustomFormat = modGeneral.H_FORMATNUMBER;
            this.TxtSoDuNo.FormatType = FormatTypeEnum.CustomFormat;
            this.TxtSoDuNo.CustomFormat = modGeneral.H_FORMATNUMBER;
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            vSHangHoa.Cols[0x10].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x11].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x13].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x15].Format = this.cFrmFormat;
            vSHangHoa = null;
        }

        private void Frm_XuatBan_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode == Keys.Escape)
            {
                if (this.CmdExit.Enabled)
                {
                    this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F2)
            {
                if (this.CmdEdit.Enabled)
                {
                    this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F3)
            {
                this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (keyCode == Keys.F5)
            {
                this.TabControl1.SelectedIndex = 0;
            }
            else if (keyCode == Keys.F6)
            {
                this.TabControl1.SelectedIndex = 1;
            }
            else if (keyCode == Keys.F8)
            {
                if (this.CmdAdd.Enabled)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F9)
            {
                if (this.CmdDel.Enabled)
                {
                    this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F10)
            {
                if (this.CmdSave.Enabled)
                {
                    this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F11)
            {
                if (this.CmdUnsave.Enabled)
                {
                    this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if ((keyCode == Keys.F12) && this.CmdPrint.Enabled)
            {
                this.CmdPrint_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        private void Frm_XuatBan_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnabledControl = false;
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                BuildComboModule.BuildCombo(this.CboLoaiHoaDon, modGeneral.ListDanhMuc.LoaiHoaDon, false, " LoaiPhatSinh = 'BR'", "");
                BuildComboModule.BuildCombo(this.CboLoaiGia, modGeneral.ListDanhMuc.LoaiGiaBan, false, "", "");
                BuildComboModule.BuildCombo(this.CboKhoHang, modGeneral.ListDanhMuc.KhoHang, false, "", "");
                this.InitComboChiNhanh();
                this.CKTachThue.Checked = modGeneral.H_GIABANBAOGOMTHUE;
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.EmptyData();
                }
                else
                {
                    this.ShowData(this.cFrmKhoa);
                }
                if (modGeneral.H_THEODOISERI)
                {
                    this.VSHangHoa.Cols[7].Visible = true;
                }
                else
                {
                    this.VSHangHoa.Cols[7].Visible = false;
                }
                this.Cursor = Cursors.Default;
            }
        }

        public void GetGiaBanCoThue()
        {
            int row = 0;
            string pKhoa = "";
            double num2 = 0.0;
            int tyLeThue = 0;
            double num4 = 0.0;
            double num3 = 0.0;
            clsDMLoaiTien tien = new clsDMLoaiTien();
            tien.Load(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String)));
            num4 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            int num6 = this.VSHangHoa.Rows.Count - 1;
            for (row = 1; row <= num6; row++)
            {
                RowColEventArgs e = new RowColEventArgs(row, 0x10);
                pKhoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[row, 4]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                if (pKhoa.Trim() == "")
                {
                    return;
                }
                this.objHH.Load(pKhoa);
                if (this.TxtSoSeri.Text.Trim() != "")
                {
                    if ((Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[row, 0x17]), 0, modGeneral.TypeOfValue.Nothing)) == 0) & modGeneral.H_GIABANBAOGOMTHUE)
                    {
                        tyLeThue = this.objHH.TyLeThue;
                        num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[row, 13]), 0, modGeneral.TypeOfValue.Nothing));
                        num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[row, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
                        num2 -= Math.Round((double) (num2 / ((double) (100 + tyLeThue))), 0) * tyLeThue;
                        this.VSHangHoa[row, 0x10] = Math.Round((double) (num2 / num4), tien.SoLe);
                        this.VSHangHoa[row, 0x11] = Math.Round((double) (num2 * num3), tien.SoLe);
                        this.VSHangHoa[row, 0x16] = tyLeThue;
                        if ((LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[row, 20]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "") && this.objLHD.LoadByRateAndType(tyLeThue, "V", "BR"))
                        {
                            this.VSHangHoa[row, 20] = this.objLHD.Khoa;
                            this.VSHangHoa[row, 0x15] = this.objLHD.Ma;
                        }
                        this.TinhThue(row);
                    }
                }
                else
                {
                    tyLeThue = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[row, 0x16]), 0, modGeneral.TypeOfValue.Nothing));
                    if (tyLeThue != 0)
                    {
                        num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[row, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
                        num2 += Math.Round((double) (num2 / 100.0), 0) * tyLeThue;
                        this.VSHangHoa[row, 0x10] = num2;
                        this.VSHangHoa[row, 0x16] = 0;
                        this.VSHangHoa_AfterEdit(this, e);
                    }
                }
            }
            this.TinhTong();
        }

        public void GetGiaVon(int nRow)
        {
            clsDMHangHoa hoa = new clsDMHangHoa();
            string pKhoaHangHoa = "";
            string pKhoaKho = "";
            string pSoSeri = "";
            pKhoaHangHoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[nRow, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            if (pKhoaHangHoa != "")
            {
                pKhoaKho = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[nRow, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                pSoSeri = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[nRow, 7]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                hoa.LoadTonKho(pKhoaHangHoa, pKhoaKho, "", "", "", "", pSoSeri, LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
                if (hoa.SoLuongTonKho == 0.0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kho kh\x00f4ng đủ h\x00e0ng xuất!", ""));
                }
                else
                {
                    this.VSHangHoa[nRow, 14] = hoa.TriGiaTonKho / hoa.SoLuongTonKho;
                }
            }
        }

        public void InitComboChiNhanh()
        {
            DataTable table = new clsDMDoiTuong().ShowListByField("Khoa|Ten" + modGeneral.H_LANGUAGE + " As Ten ", " CHARINDEX('U', Loai) <> 0 ", "");
            this.CboChiNhanh.DataSource = table;
            this.CboChiNhanh.ValueMember = "Khoa";
            this.CboChiNhanh.DisplayMember = "Ten";
        }

        public void InitDefault()
        {
            this.AdvTaiKhoanChu.SetDefault();
            this.AdvTaiKhoanThue.SetDefault();
            this.AdvTKChietKhau.SetDefault();
            this.AdvTKDoanhThu.SetDefault();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_HoaDonChiNhanh));
            this.CKChietKhauTheoHD = new CheckBox();
            this.CKHienThiHoaDon = new CheckBox();
            this.TabControl1 = new TabControl();
            this.TabPage1 = new TabPage();
            this.CboChiNhanh = new ComboBox();
            this.TxtTinhThue = new DateTimePicker();
            this.CboKhoHang = new ComboBox();
            this.Label31 = new Label();
            this.Label18 = new Label();
            this.Label17 = new Label();
            this.Label20 = new Label();
            this.Label2 = new Label();
            this.Label25 = new Label();
            this.TxtSoNgayThanhToan = new C1NumericEdit();
            this.GroupBox1 = new GroupBox();
            this.TxtTenDoiTuongThue = new TextBox();
            this.Label15 = new Label();
            this.CmdDTThue = new Button();
            this.TxtDiaChiThue = new TextBox();
            this.Label8 = new Label();
            this.TxtSoSeri = new TextBox();
            this.Label14 = new Label();
            this.CboLoaiHoaDon = new ComboBox();
            this.Label7 = new Label();
            this.TxtMaSoThue = new TextBox();
            this.TxtSoHoaDon = new TextBox();
            this.TxtNgayHoaDon = new DateTimePicker();
            this.Label12 = new Label();
            this.Label30 = new Label();
            this.CboLoaiGia = new ComboBox();
            this.Label19 = new Label();
            this.Label24 = new Label();
            this.TxtNgayToiHanThanhToan = new DateTimePicker();
            this.Label16 = new Label();
            this.TxtDienGiai = new TextBox();
            this.Label9 = new Label();
            this.Label3 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.TxtSoDuNo = new C1NumericEdit();
            this.Panel4 = new Panel();
            this.GroupBox2 = new GroupBox();
            this.Button2 = new Button();
            this.Label27 = new Label();
            this.TxtGioiHanNo = new C1NumericEdit();
            this.Label26 = new Label();
            this.CKTachThue = new CheckBox();
            this.CmdDelRow = new Button();
            this.CmdAddRow = new Button();
            this.Panel5 = new Panel();
            this.TxtTyLeChietKhau = new C1NumericEdit();
            this.TxtThueSuat = new C1NumericEdit();
            this.TxtTongThanhToanNT = new C1NumericEdit();
            this.TxtTongThanhToan = new C1NumericEdit();
            this.Label23 = new Label();
            this.TxtTienThueNT = new C1NumericEdit();
            this.TxtTienHangNT = new C1NumericEdit();
            this.TxtChietKhauNT = new C1NumericEdit();
            this.TxtTienThue = new C1NumericEdit();
            this.TxtTienHang = new C1NumericEdit();
            this.TxtChietKhau = new C1NumericEdit();
            this.Label22 = new Label();
            this.Label21 = new Label();
            this.Label5 = new Label();
            this.mnChungTuGoc = new ContextMenuStrip(this.components);
            this.mnDonHang = new ToolStripMenuItem();
            this.mnBaoGia = new ToolStripMenuItem();
            this.VSDichVu = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TabPage2 = new TabPage();
            this.TabControl2 = new TabControl();
            this.TabPage4 = new TabPage();
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripSplitButton();
            this.cmdPhieuXuat = new ToolStripMenuItem();
            this.cmdPrintVATMau = new ToolStripMenuItem();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.CmdHoaHong = new ToolStripButton();
            this.ToolStripSeparator4 = new ToolStripSeparator();
            this.ToolStripButton2 = new ToolStripButton();
            this.CmdCongNo = new ToolStripButton();
            this.AdvTKChietKhau = new ADVAccount();
            this.AdvTKDoanhThu = new ADVAccount();
            this.AdvTaiKhoanThue = new ADVAccount();
            this.AdvTaiKhoanChu = new ADVAccount();
            this.AdvGiaoNhan = new ADVObjects();
            this.AdvNhanVien = new ADVObjects();
            this.VSHangHoa = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TabControl1.SuspendLayout();
            this.TabPage1.SuspendLayout();
            ((ISupportInitialize) this.TxtSoNgayThanhToan).BeginInit();
            this.GroupBox1.SuspendLayout();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            ((ISupportInitialize) this.TxtSoDuNo).BeginInit();
            this.Panel4.SuspendLayout();
            this.GroupBox2.SuspendLayout();
            ((ISupportInitialize) this.TxtGioiHanNo).BeginInit();
            this.Panel5.SuspendLayout();
            ((ISupportInitialize) this.TxtTyLeChietKhau).BeginInit();
            ((ISupportInitialize) this.TxtThueSuat).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToan).BeginInit();
            ((ISupportInitialize) this.TxtTienThueNT).BeginInit();
            ((ISupportInitialize) this.TxtTienHangNT).BeginInit();
            ((ISupportInitialize) this.TxtChietKhauNT).BeginInit();
            ((ISupportInitialize) this.TxtTienThue).BeginInit();
            ((ISupportInitialize) this.TxtTienHang).BeginInit();
            ((ISupportInitialize) this.TxtChietKhau).BeginInit();
            this.mnChungTuGoc.SuspendLayout();
            this.VSDichVu.BeginInit();
            this.TabPage2.SuspendLayout();
            this.TabControl2.SuspendLayout();
            this.TabPage4.SuspendLayout();
            this.ToolStrip1.SuspendLayout();
            this.VSHangHoa.BeginInit();
            this.SuspendLayout();
            this.CKChietKhauTheoHD.AutoSize = true;
            Point point = new Point(0x17b, 0x63);
            this.CKChietKhauTheoHD.Location = point;
            this.CKChietKhauTheoHD.Name = "CKChietKhauTheoHD";
            Size size = new Size(0x90, 0x11);
            this.CKChietKhauTheoHD.Size = size;
            this.CKChietKhauTheoHD.TabIndex = 160;
            this.CKChietKhauTheoHD.Text = "Chiết khấu theo h\x00f3a đơn";
            this.CKChietKhauTheoHD.UseVisualStyleBackColor = true;
            this.CKHienThiHoaDon.AutoSize = true;
            point = new Point(0xc2, 5);
            this.CKHienThiHoaDon.Location = point;
            this.CKHienThiHoaDon.Name = "CKHienThiHoaDon";
            size = new Size(0x77, 0x11);
            this.CKHienThiHoaDon.Size = size;
            this.CKHienThiHoaDon.TabIndex = 0x9f;
            this.CKHienThiHoaDon.Text = "Hiển thị số h\x00f3a đơn";
            this.CKHienThiHoaDon.UseVisualStyleBackColor = true;
            this.TabControl1.Controls.Add(this.TabPage1);
            this.TabControl1.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.TabControl1.Location = point;
            this.TabControl1.Name = "TabControl1";
            this.TabControl1.SelectedIndex = 0;
            size = new Size(0x37e, 0xd4);
            this.TabControl1.Size = size;
            this.TabControl1.TabIndex = 0x17;
            this.TabPage1.Controls.Add(this.CboChiNhanh);
            this.TabPage1.Controls.Add(this.TxtTinhThue);
            this.TabPage1.Controls.Add(this.CboKhoHang);
            this.TabPage1.Controls.Add(this.Label31);
            this.TabPage1.Controls.Add(this.Label18);
            this.TabPage1.Controls.Add(this.Label17);
            this.TabPage1.Controls.Add(this.Label20);
            this.TabPage1.Controls.Add(this.Label2);
            this.TabPage1.Controls.Add(this.AdvTKChietKhau);
            this.TabPage1.Controls.Add(this.AdvTKDoanhThu);
            this.TabPage1.Controls.Add(this.AdvTaiKhoanThue);
            this.TabPage1.Controls.Add(this.AdvTaiKhoanChu);
            this.TabPage1.Controls.Add(this.AdvGiaoNhan);
            this.TabPage1.Controls.Add(this.Label25);
            this.TabPage1.Controls.Add(this.TxtSoNgayThanhToan);
            this.TabPage1.Controls.Add(this.GroupBox1);
            this.TabPage1.Controls.Add(this.CboLoaiGia);
            this.TabPage1.Controls.Add(this.Label19);
            this.TabPage1.Controls.Add(this.AdvNhanVien);
            this.TabPage1.Controls.Add(this.Label24);
            this.TabPage1.Controls.Add(this.TxtNgayToiHanThanhToan);
            this.TabPage1.Controls.Add(this.Label16);
            this.TabPage1.Controls.Add(this.TxtDienGiai);
            this.TabPage1.Controls.Add(this.Label9);
            this.TabPage1.Controls.Add(this.Label3);
            this.TabPage1.Controls.Add(this.CboLoaiTien);
            this.TabPage1.Controls.Add(this.txtTyGia);
            this.TabPage1.Controls.Add(this.Label11);
            this.TabPage1.Controls.Add(this.Label10);
            this.TabPage1.Controls.Add(this.Label13);
            this.TabPage1.Controls.Add(this.TxtNgayChungTu);
            this.TabPage1.Controls.Add(this.Label1);
            this.TabPage1.Controls.Add(this.TxtSoChungTu);
            point = new Point(4, 0x16);
            this.TabPage1.Location = point;
            this.TabPage1.Name = "TabPage1";
            Padding padding = new Padding(3);
            this.TabPage1.Padding = padding;
            size = new Size(0x376, 0xba);
            this.TabPage1.Size = size;
            this.TabPage1.TabIndex = 0;
            this.TabPage1.Text = "Th\x00f4ng tin phiếu xuất b\x00e1n";
            this.TabPage1.UseVisualStyleBackColor = true;
            this.CboChiNhanh.FormattingEnabled = true;
            point = new Point(0x65, 0x30);
            this.CboChiNhanh.Location = point;
            this.CboChiNhanh.Name = "CboChiNhanh";
            size = new Size(0x12f, 0x15);
            this.CboChiNhanh.Size = size;
            this.CboChiNhanh.TabIndex = 160;
            this.TxtTinhThue.Format = DateTimePickerFormat.Custom;
            point = new Point(0x31a, 0xd1);
            this.TxtTinhThue.Location = point;
            this.TxtTinhThue.Name = "TxtTinhThue";
            size = new Size(0x54, 20);
            this.TxtTinhThue.Size = size;
            this.TxtTinhThue.TabIndex = 0x9f;
            this.CboKhoHang.FormattingEnabled = true;
            point = new Point(0x65, 0x8a);
            this.CboKhoHang.Location = point;
            this.CboKhoHang.Name = "CboKhoHang";
            size = new Size(0x12f, 0x15);
            this.CboKhoHang.Size = size;
            this.CboKhoHang.TabIndex = 0x12;
            this.Label31.AutoSize = true;
            point = new Point(9, 140);
            this.Label31.Location = point;
            this.Label31.Name = "Label31";
            size = new Size(0x35, 13);
            this.Label31.Size = size;
            this.Label31.TabIndex = 0x66;
            this.Label31.Text = "Kho h\x00e0ng";
            this.Label18.AutoSize = true;
            point = new Point(0x1ab, 0xa4);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(0x4d, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 0x27;
            this.Label18.Text = "TK. chiết khấu";
            this.Label17.AutoSize = true;
            point = new Point(0x1ab, 0x8f);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            size = new Size(0x4b, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 0x25;
            this.Label17.Text = "TK. doanh thu";
            this.Label20.AutoSize = true;
            point = new Point(0x1ab, 0x79);
            this.Label20.Location = point;
            this.Label20.Name = "Label20";
            size = new Size(0x30, 13);
            this.Label20.Size = size;
            this.Label20.TabIndex = 0x23;
            this.Label20.Text = "TK. thuế";
            this.Label2.AutoSize = true;
            point = new Point(0x1ab, 0x63);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x4e, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x21;
            this.Label2.Text = "TK. thanh to\x00e1n";
            this.Label25.AutoEllipsis = true;
            this.Label25.AutoSize = true;
            point = new Point(9, 0x77);
            this.Label25.Location = point;
            this.Label25.Name = "Label25";
            this.Label25.RightToLeft = RightToLeft.No;
            size = new Size(0x38, 13);
            this.Label25.Size = size;
            this.Label25.TabIndex = 0x10;
            this.Label25.Text = "Giao nhận";
            this.Label25.TextAlign = ContentAlignment.TopRight;
            this.TxtSoNgayThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoNgayThanhToan.DataType = typeof(short);
            this.TxtSoNgayThanhToan.FormatType = FormatTypeEnum.Integer;
            point = new Point(0x124, 0x47);
            this.TxtSoNgayThanhToan.Location = point;
            this.TxtSoNgayThanhToan.Name = "TxtSoNgayThanhToan";
            padding = new Padding(1);
            this.TxtSoNgayThanhToan.Padding = padding;
            size = new Size(0x15, 20);
            this.TxtSoNgayThanhToan.Size = size;
            this.TxtSoNgayThanhToan.TabIndex = 13;
            this.TxtSoNgayThanhToan.Tag = null;
            this.TxtSoNgayThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoNgayThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoNgayThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.GroupBox1.Controls.Add(this.TxtTenDoiTuongThue);
            this.GroupBox1.Controls.Add(this.Label15);
            this.GroupBox1.Controls.Add(this.CmdDTThue);
            this.GroupBox1.Controls.Add(this.TxtDiaChiThue);
            this.GroupBox1.Controls.Add(this.Label8);
            this.GroupBox1.Controls.Add(this.TxtSoSeri);
            this.GroupBox1.Controls.Add(this.Label14);
            this.GroupBox1.Controls.Add(this.CboLoaiHoaDon);
            this.GroupBox1.Controls.Add(this.Label7);
            this.GroupBox1.Controls.Add(this.TxtMaSoThue);
            this.GroupBox1.Controls.Add(this.TxtSoHoaDon);
            this.GroupBox1.Controls.Add(this.TxtNgayHoaDon);
            this.GroupBox1.Controls.Add(this.Label12);
            this.GroupBox1.Controls.Add(this.Label30);
            point = new Point(0x1a9, 1);
            this.GroupBox1.Location = point;
            this.GroupBox1.Name = "GroupBox1";
            size = new Size(0x1c5, 0x5b);
            this.GroupBox1.Size = size;
            this.GroupBox1.TabIndex = 0x13;
            this.GroupBox1.TabStop = false;
            this.GroupBox1.Text = "Th\x00f4ng tin h\x00f3a đơn";
            point = new Point(0x56, 0x2a);
            this.TxtTenDoiTuongThue.Location = point;
            this.TxtTenDoiTuongThue.Name = "TxtTenDoiTuongThue";
            this.TxtTenDoiTuongThue.ReadOnly = true;
            size = new Size(0x148, 20);
            this.TxtTenDoiTuongThue.Size = size;
            this.TxtTenDoiTuongThue.TabIndex = 0x9e;
            this.Label15.AutoEllipsis = true;
            this.Label15.AutoSize = true;
            point = new Point(4, 0x2d);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            this.Label15.RightToLeft = RightToLeft.No;
            size = new Size(0x4d, 13);
            this.Label15.Size = size;
            this.Label15.TabIndex = 0x9d;
            this.Label15.Text = "Đối tượng thuế";
            this.Label15.TextAlign = ContentAlignment.TopRight;
            this.CmdDTThue.BackgroundImage = ACCOUNTING.My.Resources.Resources.view;
            this.CmdDTThue.BackgroundImageLayout = ImageLayout.Stretch;
            point = new Point(0x19e, 0x29);
            this.CmdDTThue.Location = point;
            padding = new Padding(0);
            this.CmdDTThue.Margin = padding;
            this.CmdDTThue.Name = "CmdDTThue";
            size = new Size(0x17, 0x16);
            this.CmdDTThue.Size = size;
            this.CmdDTThue.TabIndex = 0x1c;
            this.CmdDTThue.Text = "...";
            this.CmdDTThue.UseVisualStyleBackColor = true;
            point = new Point(0x58, 0x5d);
            this.TxtDiaChiThue.Location = point;
            this.TxtDiaChiThue.Name = "TxtDiaChiThue";
            size = new Size(0x124, 20);
            this.TxtDiaChiThue.Size = size;
            this.TxtDiaChiThue.TabIndex = 0x9c;
            this.Label8.AutoSize = true;
            point = new Point(0x13b, 0x16);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x20, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x18;
            this.Label8.Text = "Ng\x00e0y";
            point = new Point(0x56, 0x13);
            this.TxtSoSeri.Location = point;
            this.TxtSoSeri.Name = "TxtSoSeri";
            size = new Size(0x54, 20);
            this.TxtSoSeri.Size = size;
            this.TxtSoSeri.TabIndex = 0x13;
            this.Label14.AutoSize = true;
            point = new Point(4, 0x17);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            size = new Size(0x27, 13);
            this.Label14.Size = size;
            this.Label14.TabIndex = 0x16;
            this.Label14.Text = "Số seri";
            this.CboLoaiHoaDon.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiHoaDon.Enabled = false;
            this.CboLoaiHoaDon.FormattingEnabled = true;
            point = new Point(0xf5, 0x42);
            this.CboLoaiHoaDon.Location = point;
            this.CboLoaiHoaDon.Name = "CboLoaiHoaDon";
            size = new Size(0xc0, 0x15);
            this.CboLoaiHoaDon.Size = size;
            this.CboLoaiHoaDon.TabIndex = 0x20;
            this.Label7.AutoSize = true;
            point = new Point(0xab, 0x45);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(70, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x1f;
            this.Label7.Text = "Loại h\x00f3a đơn";
            this.Label7.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x56, 0x42);
            this.TxtMaSoThue.Location = point;
            this.TxtMaSoThue.Name = "TxtMaSoThue";
            this.TxtMaSoThue.ReadOnly = true;
            size = new Size(0x54, 20);
            this.TxtMaSoThue.Size = size;
            this.TxtMaSoThue.TabIndex = 30;
            point = new Point(0xf1, 0x13);
            this.TxtSoHoaDon.Location = point;
            this.TxtSoHoaDon.Name = "TxtSoHoaDon";
            this.TxtSoHoaDon.ReadOnly = true;
            size = new Size(0x42, 20);
            this.TxtSoHoaDon.Size = size;
            this.TxtSoHoaDon.TabIndex = 0x15;
            this.TxtNgayHoaDon.Enabled = false;
            this.TxtNgayHoaDon.Format = DateTimePickerFormat.Custom;
            point = new Point(0x161, 0x13);
            this.TxtNgayHoaDon.Location = point;
            this.TxtNgayHoaDon.Name = "TxtNgayHoaDon";
            size = new Size(0x54, 20);
            this.TxtNgayHoaDon.Size = size;
            this.TxtNgayHoaDon.TabIndex = 0x19;
            this.Label12.AutoSize = true;
            point = new Point(0xb0, 0x16);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            size = new Size(0x3f, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 20;
            this.Label12.Text = "Số h\x00f3a đơn";
            this.Label30.AutoEllipsis = true;
            this.Label30.AutoSize = true;
            point = new Point(4, 70);
            this.Label30.Location = point;
            this.Label30.Name = "Label30";
            this.Label30.RightToLeft = RightToLeft.No;
            size = new Size(60, 13);
            this.Label30.Size = size;
            this.Label30.TabIndex = 0x1d;
            this.Label30.Text = "M\x00e3 số thuế";
            this.Label30.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiGia.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiGia.FormattingEnabled = true;
            point = new Point(0x65, 0x47);
            this.CboLoaiGia.Location = point;
            this.CboLoaiGia.Name = "CboLoaiGia";
            size = new Size(0x6c, 0x15);
            this.CboLoaiGia.Size = size;
            this.CboLoaiGia.TabIndex = 11;
            this.Label19.AutoSize = true;
            point = new Point(9, 0x4b);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            size = new Size(0x2c, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 10;
            this.Label19.Text = "Loại gi\x00e1";
            this.Label19.TextAlign = ContentAlignment.TopRight;
            this.Label24.AutoSize = true;
            point = new Point(0xd4, 0x4b);
            this.Label24.Location = point;
            this.Label24.Name = "Label24";
            size = new Size(0x51, 13);
            this.Label24.Size = size;
            this.Label24.TabIndex = 12;
            this.Label24.Text = "Hạn thanh to\x00e1n";
            this.TxtNgayToiHanThanhToan.Format = DateTimePickerFormat.Custom;
            point = new Point(0x13b, 0x47);
            this.TxtNgayToiHanThanhToan.Location = point;
            this.TxtNgayToiHanThanhToan.Name = "TxtNgayToiHanThanhToan";
            size = new Size(0x59, 20);
            this.TxtNgayToiHanThanhToan.Size = size;
            this.TxtNgayToiHanThanhToan.TabIndex = 14;
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            point = new Point(9, 0x34);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x37, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 8;
            this.Label16.Text = "Chi nh\x00e1nh";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            point = new Point(0x65, 0xa2);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x12f, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 20;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            point = new Point(9, 0xa5);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x30, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x12;
            this.Label9.Text = "Diễn giải";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            this.Label3.AutoEllipsis = true;
            this.Label3.AutoSize = true;
            point = new Point(9, 0x62);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            this.Label3.RightToLeft = RightToLeft.No;
            size = new Size(0x4d, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 14;
            this.Label3.Text = "Nh\x00e2n vi\x00ean b\x00e1n";
            this.Label3.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiTien.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x65, 0x1a);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x6c, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 5;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x124, 0x1a);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            padding = new Padding(1);
            this.txtTyGia.Padding = padding;
            size = new Size(0x70, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 7;
            this.txtTyGia.Tag = null;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.txtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.txtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label11.AutoSize = true;
            point = new Point(9, 0x1d);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 4;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            point = new Point(0xd7, 0x1d);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 6;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label13.AutoSize = true;
            point = new Point(9, 7);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Custom;
            point = new Point(0x65, 4);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x6c, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 1;
            this.Label1.AutoSize = true;
            point = new Point(0xd8, 7);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 2;
            this.Label1.Text = "Số chứng từ";
            point = new Point(0x124, 4);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x70, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 3;
            this.TxtSoDuNo.DataType = typeof(double);
            this.TxtSoDuNo.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x85, 0x18);
            this.TxtSoDuNo.Location = point;
            this.TxtSoDuNo.Name = "TxtSoDuNo";
            this.TxtSoDuNo.ReadOnly = true;
            size = new Size(110, 20);
            this.TxtSoDuNo.Size = size;
            this.TxtSoDuNo.TabIndex = 0x8d;
            this.TxtSoDuNo.Tag = null;
            this.TxtSoDuNo.TextAlign = HorizontalAlignment.Right;
            this.TxtSoDuNo.VisibleButtons = DropDownControlButtonFlags.None;
            this.Panel4.Controls.Add(this.CKChietKhauTheoHD);
            this.Panel4.Controls.Add(this.CKHienThiHoaDon);
            this.Panel4.Controls.Add(this.GroupBox2);
            this.Panel4.Controls.Add(this.CKTachThue);
            this.Panel4.Controls.Add(this.CmdDelRow);
            this.Panel4.Controls.Add(this.CmdAddRow);
            this.Panel4.Controls.Add(this.Panel5);
            this.Panel4.Dock = DockStyle.Bottom;
            point = new Point(0, 0x202);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x37e, 0x5e);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 0x18;
            this.GroupBox2.Controls.Add(this.Button2);
            this.GroupBox2.Controls.Add(this.TxtSoDuNo);
            this.GroupBox2.Controls.Add(this.Label27);
            this.GroupBox2.Controls.Add(this.TxtGioiHanNo);
            this.GroupBox2.Controls.Add(this.Label26);
            point = new Point(0x132, 0x63);
            this.GroupBox2.Location = point;
            this.GroupBox2.Name = "GroupBox2";
            size = new Size(0x116, 0x2f);
            this.GroupBox2.Size = size;
            this.GroupBox2.TabIndex = 0x16;
            this.GroupBox2.TabStop = false;
            this.Button2.BackgroundImage = ACCOUNTING.My.Resources.Resources.view;
            this.Button2.BackgroundImageLayout = ImageLayout.Stretch;
            point = new Point(0xf4, 0x17);
            this.Button2.Location = point;
            padding = new Padding(0);
            this.Button2.Margin = padding;
            this.Button2.Name = "Button2";
            size = new Size(0x17, 0x16);
            this.Button2.Size = size;
            this.Button2.TabIndex = 0x8e;
            this.Button2.UseVisualStyleBackColor = true;
            this.Label27.AutoSize = true;
            point = new Point(130, 9);
            this.Label27.Location = point;
            this.Label27.Name = "Label27";
            size = new Size(0x57, 13);
            this.Label27.Size = size;
            this.Label27.TabIndex = 140;
            this.Label27.Text = "Số dư nợ hiện tại";
            this.TxtGioiHanNo.DataType = typeof(double);
            this.TxtGioiHanNo.FormatType = FormatTypeEnum.Currency;
            point = new Point(6, 0x18);
            this.TxtGioiHanNo.Location = point;
            this.TxtGioiHanNo.Name = "TxtGioiHanNo";
            this.TxtGioiHanNo.ReadOnly = true;
            size = new Size(0x6f, 20);
            this.TxtGioiHanNo.Size = size;
            this.TxtGioiHanNo.TabIndex = 0x8b;
            this.TxtGioiHanNo.Tag = null;
            this.TxtGioiHanNo.TextAlign = HorizontalAlignment.Right;
            this.TxtGioiHanNo.VisibleButtons = DropDownControlButtonFlags.None;
            this.Label26.AutoSize = true;
            point = new Point(3, 9);
            this.Label26.Location = point;
            this.Label26.Name = "Label26";
            size = new Size(0x3d, 13);
            this.Label26.Size = size;
            this.Label26.TabIndex = 0x8a;
            this.Label26.Text = "Giới hạn nợ";
            this.CKTachThue.AutoSize = true;
            this.CKTachThue.Checked = true;
            this.CKTachThue.CheckState = CheckState.Checked;
            point = new Point(0xc1, 0x70);
            this.CKTachThue.Location = point;
            this.CKTachThue.Name = "CKTachThue";
            size = new Size(0x7d, 0x11);
            this.CKTachThue.Size = size;
            this.CKTachThue.TabIndex = 0x15;
            this.CKTachThue.Text = "T\x00e1ch thuế từ gi\x00e1 b\x00e1n";
            this.CKTachThue.UseVisualStyleBackColor = true;
            this.CmdDelRow.Image = (Image) manager.GetObject("CmdDelRow.Image");
            this.CmdDelRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x62, 1);
            this.CmdDelRow.Location = point;
            this.CmdDelRow.Name = "CmdDelRow";
            size = new Size(90, 0x18);
            this.CmdDelRow.Size = size;
            this.CmdDelRow.TabIndex = 0x16;
            this.CmdDelRow.Text = "&2.X\x00f3a d\x00f2ng";
            this.CmdDelRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdDelRow.UseVisualStyleBackColor = true;
            this.CmdAddRow.Image = (Image) manager.GetObject("CmdAddRow.Image");
            this.CmdAddRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(3, 1);
            this.CmdAddRow.Location = point;
            this.CmdAddRow.Name = "CmdAddRow";
            size = new Size(0x5d, 0x18);
            this.CmdAddRow.Size = size;
            this.CmdAddRow.TabIndex = 0x15;
            this.CmdAddRow.Text = "&1.Th\x00eam d\x00f2ng";
            this.CmdAddRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdAddRow.UseVisualStyleBackColor = true;
            this.Panel5.Controls.Add(this.TxtTyLeChietKhau);
            this.Panel5.Controls.Add(this.TxtThueSuat);
            this.Panel5.Controls.Add(this.TxtTongThanhToanNT);
            this.Panel5.Controls.Add(this.TxtTongThanhToan);
            this.Panel5.Controls.Add(this.Label23);
            this.Panel5.Controls.Add(this.TxtTienThueNT);
            this.Panel5.Controls.Add(this.TxtTienHangNT);
            this.Panel5.Controls.Add(this.TxtChietKhauNT);
            this.Panel5.Controls.Add(this.TxtTienThue);
            this.Panel5.Controls.Add(this.TxtTienHang);
            this.Panel5.Controls.Add(this.TxtChietKhau);
            this.Panel5.Controls.Add(this.Label22);
            this.Panel5.Controls.Add(this.Label21);
            this.Panel5.Controls.Add(this.Label5);
            this.Panel5.Dock = DockStyle.Right;
            point = new Point(0x24b, 0);
            this.Panel5.Location = point;
            this.Panel5.Name = "Panel5";
            size = new Size(0x133, 0x5e);
            this.Panel5.Size = size;
            this.Panel5.TabIndex = 0;
            this.TxtTyLeChietKhau.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTyLeChietKhau.DataType = typeof(short);
            this.TxtTyLeChietKhau.FormatType = FormatTypeEnum.Integer;
            point = new Point(0x59, 0x19);
            this.TxtTyLeChietKhau.Location = point;
            this.TxtTyLeChietKhau.Name = "TxtTyLeChietKhau";
            padding = new Padding(1);
            this.TxtTyLeChietKhau.Padding = padding;
            size = new Size(0x16, 20);
            this.TxtTyLeChietKhau.Size = size;
            this.TxtTyLeChietKhau.TabIndex = 0x8b;
            this.TxtTyLeChietKhau.Tag = null;
            this.TxtTyLeChietKhau.Value = (short) 0;
            this.TxtTyLeChietKhau.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTyLeChietKhau.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTyLeChietKhau.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtThueSuat.BorderStyle = BorderStyle.FixedSingle;
            this.TxtThueSuat.DataType = typeof(short);
            this.TxtThueSuat.FormatType = FormatTypeEnum.Integer;
            point = new Point(0x59, 0x30);
            this.TxtThueSuat.Location = point;
            this.TxtThueSuat.Name = "TxtThueSuat";
            padding = new Padding(1);
            this.TxtThueSuat.Padding = padding;
            size = new Size(0x16, 20);
            this.TxtThueSuat.Size = size;
            this.TxtThueSuat.TabIndex = 0x8e;
            this.TxtThueSuat.Tag = null;
            this.TxtThueSuat.Value = (short) 0;
            this.TxtThueSuat.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtThueSuat.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtThueSuat.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToanNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToanNT.DataType = typeof(double);
            this.TxtTongThanhToanNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x59, 0x47);
            this.TxtTongThanhToanNT.Location = point;
            this.TxtTongThanhToanNT.Name = "TxtTongThanhToanNT";
            padding = new Padding(1);
            this.TxtTongThanhToanNT.Padding = padding;
            this.TxtTongThanhToanNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTongThanhToanNT.Size = size;
            this.TxtTongThanhToanNT.TabIndex = 0x89;
            this.TxtTongThanhToanNT.Tag = null;
            this.TxtTongThanhToanNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToanNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToanNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToanNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToan.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToan.DataType = typeof(double);
            this.TxtTongThanhToan.FormatType = FormatTypeEnum.Currency;
            point = new Point(0xc9, 0x47);
            this.TxtTongThanhToan.Location = point;
            this.TxtTongThanhToan.Name = "TxtTongThanhToan";
            padding = new Padding(1);
            this.TxtTongThanhToan.Padding = padding;
            this.TxtTongThanhToan.ReadOnly = true;
            size = new Size(0x66, 20);
            this.TxtTongThanhToan.Size = size;
            this.TxtTongThanhToan.TabIndex = 0x88;
            this.TxtTongThanhToan.Tag = null;
            this.TxtTongThanhToan.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToan.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToan.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToan.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label23.AutoSize = true;
            point = new Point(2, 0x4b);
            this.Label23.Location = point;
            this.Label23.Name = "Label23";
            size = new Size(0x56, 13);
            this.Label23.Size = size;
            this.Label23.TabIndex = 0x87;
            this.Label23.Text = "Tổng thanh to\x00e1n";
            this.TxtTienThueNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThueNT.DataType = typeof(double);
            this.TxtTienThueNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x71, 0x30);
            this.TxtTienThueNT.Location = point;
            this.TxtTienThueNT.Name = "TxtTienThueNT";
            padding = new Padding(1);
            this.TxtTienThueNT.Padding = padding;
            this.TxtTienThueNT.ReadOnly = true;
            size = new Size(0x55, 20);
            this.TxtTienThueNT.Size = size;
            this.TxtTienThueNT.TabIndex = 0x8f;
            this.TxtTienThueNT.Tag = null;
            this.TxtTienThueNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienThueNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThueNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThueNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHangNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHangNT.DataType = typeof(double);
            this.TxtTienHangNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x59, 2);
            this.TxtTienHangNT.Location = point;
            this.TxtTienHangNT.Name = "TxtTienHangNT";
            padding = new Padding(1);
            this.TxtTienHangNT.Padding = padding;
            this.TxtTienHangNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTienHangNT.Size = size;
            this.TxtTienHangNT.TabIndex = 120;
            this.TxtTienHangNT.Tag = null;
            this.TxtTienHangNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHangNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienHangNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHangNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhauNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChietKhauNT.DataType = typeof(double);
            this.TxtChietKhauNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x71, 0x19);
            this.TxtChietKhauNT.Location = point;
            this.TxtChietKhauNT.Name = "TxtChietKhauNT";
            padding = new Padding(1);
            this.TxtChietKhauNT.Padding = padding;
            this.TxtChietKhauNT.ReadOnly = true;
            size = new Size(0x55, 20);
            this.TxtChietKhauNT.Size = size;
            this.TxtChietKhauNT.TabIndex = 140;
            this.TxtChietKhauNT.Tag = null;
            this.TxtChietKhauNT.TextAlign = HorizontalAlignment.Right;
            this.TxtChietKhauNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChietKhauNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhauNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThue.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThue.DataType = typeof(double);
            this.TxtTienThue.FormatType = FormatTypeEnum.Currency;
            point = new Point(0xc9, 0x30);
            this.TxtTienThue.Location = point;
            this.TxtTienThue.Name = "TxtTienThue";
            padding = new Padding(1);
            this.TxtTienThue.Padding = padding;
            this.TxtTienThue.ReadOnly = true;
            size = new Size(0x66, 20);
            this.TxtTienThue.Size = size;
            this.TxtTienThue.TabIndex = 0x8d;
            this.TxtTienThue.Tag = null;
            this.TxtTienThue.TextAlign = HorizontalAlignment.Right;
            this.TxtTienThue.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThue.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThue.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHang.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHang.DataType = typeof(double);
            this.TxtTienHang.FormatType = FormatTypeEnum.Currency;
            point = new Point(0xc9, 2);
            this.TxtTienHang.Location = point;
            this.TxtTienHang.Name = "TxtTienHang";
            padding = new Padding(1);
            this.TxtTienHang.Padding = padding;
            this.TxtTienHang.ReadOnly = true;
            size = new Size(0x66, 20);
            this.TxtTienHang.Size = size;
            this.TxtTienHang.TabIndex = 130;
            this.TxtTienHang.Tag = null;
            this.TxtTienHang.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHang.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienHang.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHang.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhau.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChietKhau.DataType = typeof(double);
            this.TxtChietKhau.FormatType = FormatTypeEnum.Currency;
            point = new Point(0xc9, 0x19);
            this.TxtChietKhau.Location = point;
            this.TxtChietKhau.Name = "TxtChietKhau";
            padding = new Padding(1);
            this.TxtChietKhau.Padding = padding;
            this.TxtChietKhau.ReadOnly = true;
            size = new Size(0x66, 20);
            this.TxtChietKhau.Size = size;
            this.TxtChietKhau.TabIndex = 0x8d;
            this.TxtChietKhau.Tag = null;
            this.TxtChietKhau.TextAlign = HorizontalAlignment.Right;
            this.TxtChietKhau.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChietKhau.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhau.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label22.AutoSize = true;
            point = new Point(2, 0x34);
            this.Label22.Location = point;
            this.Label22.Name = "Label22";
            size = new Size(0x34, 13);
            this.Label22.Size = size;
            this.Label22.TabIndex = 0x75;
            this.Label22.Text = "Tiền thuế";
            this.Label21.AutoSize = true;
            point = new Point(2, 0x1d);
            this.Label21.Location = point;
            this.Label21.Name = "Label21";
            size = new Size(0x51, 13);
            this.Label21.Size = size;
            this.Label21.TabIndex = 0x74;
            this.Label21.Text = "Tiền chiết khấu";
            this.Label5.AutoSize = true;
            point = new Point(2, 6);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x37, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x73;
            this.Label5.Text = "Tiền h\x00e0ng";
            this.mnChungTuGoc.Items.AddRange(new ToolStripItem[] { this.mnDonHang, this.mnBaoGia });
            this.mnChungTuGoc.Name = "mnChungTuGoc";
            size = new Size(0x98, 0x30);
            this.mnChungTuGoc.Size = size;
            this.mnDonHang.Name = "mnDonHang";
            size = new Size(0x97, 0x16);
            this.mnDonHang.Size = size;
            this.mnDonHang.Text = "Đơn đặt h\x00e0ng";
            this.mnBaoGia.Name = "mnBaoGia";
            size = new Size(0x97, 0x16);
            this.mnBaoGia.Size = size;
            this.mnBaoGia.Text = "B\x00e1o gi\x00e1";
            this.VSDichVu.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSDichVu.ColumnInfo = manager.GetString("VSDichVu.ColumnInfo");
            this.VSDichVu.Dock = DockStyle.Fill;
            this.VSDichVu.ExtendLastCol = true;
            this.VSDichVu.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0);
            this.VSDichVu.Location = point;
            padding = new Padding(0);
            this.VSDichVu.Margin = padding;
            this.VSDichVu.Name = "VSDichVu";
            this.VSDichVu.Rows.Count = 1;
            this.VSDichVu.Rows.DefaultSize = 0x11;
            size = new Size(0x376, 0x159);
            this.VSDichVu.Size = size;
            this.VSDichVu.StyleInfo = manager.GetString("VSDichVu.StyleInfo");
            this.VSDichVu.TabIndex = 0x11;
            this.TabPage2.Controls.Add(this.VSHangHoa);
            point = new Point(4, 0x16);
            this.TabPage2.Location = point;
            this.TabPage2.Name = "TabPage2";
            size = new Size(0x376, 0x159);
            this.TabPage2.Size = size;
            this.TabPage2.TabIndex = 0;
            this.TabPage2.Text = "Chi tiết h\x00e0ng h\x00f3a";
            this.TabPage2.UseVisualStyleBackColor = true;
            this.TabControl2.Controls.Add(this.TabPage2);
            this.TabControl2.Controls.Add(this.TabPage4);
            this.TabControl2.Dock = DockStyle.Fill;
            point = new Point(0, 0xed);
            this.TabControl2.Location = point;
            this.TabControl2.Name = "TabControl2";
            this.TabControl2.SelectedIndex = 0;
            size = new Size(0x37e, 0x173);
            this.TabControl2.Size = size;
            this.TabControl2.TabIndex = 0x19;
            this.TabPage4.Controls.Add(this.VSDichVu);
            point = new Point(4, 0x16);
            this.TabPage4.Location = point;
            this.TabPage4.Name = "TabPage4";
            size = new Size(0x376, 0x159);
            this.TabPage4.Size = size;
            this.TabPage4.TabIndex = 1;
            this.TabPage4.Text = "Dịch vụ k\x00e8m theo";
            this.TabPage4.UseVisualStyleBackColor = true;
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.CmdHoaHong, this.ToolStripSeparator4, this.ToolStripButton2, this.CmdCongNo });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x37e, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0x1a;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x48, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdAdd.ToolTipText = "F8 Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.CmdEdit.ToolTipText = "F2 Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2d, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdSave.ToolTipText = "F10 Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x37, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.CmdUnsave.ToolTipText = "F11 K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x43, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdFind.ToolTipText = "F3 T\x00ecm kiếm";
            this.CmdPrint.DropDownItems.AddRange(new ToolStripItem[] { this.cmdPhieuXuat, this.cmdPrintVATMau });
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x31, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.CmdPrint.ToolTipText = "F12 In";
            this.cmdPhieuXuat.Name = "cmdPhieuXuat";
            size = new Size(0xc3, 0x16);
            this.cmdPhieuXuat.Size = size;
            this.cmdPhieuXuat.Text = "Phiếu xuất";
            this.cmdPrintVATMau.Name = "cmdPrintVATMau";
            size = new Size(0xc3, 0x16);
            this.cmdPrintVATMau.Size = size;
            this.cmdPrintVATMau.Text = "H\x00f3a đơn VAT theo mẫu";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2d, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.CmdDel.ToolTipText = "F9 X\x00f3a";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x37, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdHoaHong.Image = (Image) manager.GetObject("CmdHoaHong.Image");
            this.CmdHoaHong.ImageTransparentColor = Color.Magenta;
            this.CmdHoaHong.Name = "CmdHoaHong";
            size = new Size(0x49, 0x16);
            this.CmdHoaHong.Size = size;
            this.CmdHoaHong.Text = "&Hoa hồng";
            this.ToolStripSeparator4.Name = "ToolStripSeparator4";
            size = new Size(6, 0x19);
            this.ToolStripSeparator4.Size = size;
            this.ToolStripButton2.Alignment = ToolStripItemAlignment.Right;
            this.ToolStripButton2.Image = (Image) manager.GetObject("ToolStripButton2.Image");
            this.ToolStripButton2.ImageScaling = ToolStripItemImageScaling.None;
            this.ToolStripButton2.ImageTransparentColor = Color.White;
            this.ToolStripButton2.Name = "ToolStripButton2";
            size = new Size(0x31, 0x16);
            this.ToolStripButton2.Size = size;
            this.ToolStripButton2.Text = "&Help";
            this.CmdCongNo.Image = ACCOUNTING.My.Resources.Resources.view;
            this.CmdCongNo.ImageTransparentColor = Color.Magenta;
            this.CmdCongNo.Name = "CmdCongNo";
            size = new Size(0x43, 0x16);
            this.CmdCongNo.Size = size;
            this.CmdCongNo.Text = "C\x00f4ng nợ";
            this.AdvTKChietKhau.Conditions = "";
            this.AdvTKChietKhau.DefaultValue = "521";
            this.AdvTKChietKhau.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTKChietKhau.KeyFilter = "521";
            point = new Point(0x1ff, 0xa1);
            this.AdvTKChietKhau.Location = point;
            padding = new Padding(0);
            this.AdvTKChietKhau.Margin = padding;
            this.AdvTKChietKhau.Name = "AdvTKChietKhau";
            this.AdvTKChietKhau.OnlyDigit = false;
            this.AdvTKChietKhau.ReadOnly = false;
            size = new Size(0x15f, 20);
            this.AdvTKChietKhau.Size = size;
            this.AdvTKChietKhau.TabIndex = 40;
            this.AdvTKChietKhau.UpperText = true;
            this.AdvTKChietKhau.Value = "";
            this.AdvTKChietKhau.WithCode = 80;
            this.AdvTKDoanhThu.Conditions = "";
            this.AdvTKDoanhThu.DefaultValue = "511";
            this.AdvTKDoanhThu.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTKDoanhThu.KeyFilter = "511";
            point = new Point(0x1ff, 0x8b);
            this.AdvTKDoanhThu.Location = point;
            padding = new Padding(0);
            this.AdvTKDoanhThu.Margin = padding;
            this.AdvTKDoanhThu.Name = "AdvTKDoanhThu";
            this.AdvTKDoanhThu.OnlyDigit = false;
            this.AdvTKDoanhThu.ReadOnly = false;
            size = new Size(0x15f, 20);
            this.AdvTKDoanhThu.Size = size;
            this.AdvTKDoanhThu.TabIndex = 0x26;
            this.AdvTKDoanhThu.UpperText = true;
            this.AdvTKDoanhThu.Value = "";
            this.AdvTKDoanhThu.WithCode = 80;
            this.AdvTaiKhoanThue.Conditions = "";
            this.AdvTaiKhoanThue.DefaultValue = "333";
            this.AdvTaiKhoanThue.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoanThue.KeyFilter = "333";
            point = new Point(0x1ff, 0x75);
            this.AdvTaiKhoanThue.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanThue.Margin = padding;
            this.AdvTaiKhoanThue.Name = "AdvTaiKhoanThue";
            this.AdvTaiKhoanThue.OnlyDigit = false;
            this.AdvTaiKhoanThue.ReadOnly = false;
            size = new Size(0x15f, 20);
            this.AdvTaiKhoanThue.Size = size;
            this.AdvTaiKhoanThue.TabIndex = 0x24;
            this.AdvTaiKhoanThue.UpperText = true;
            this.AdvTaiKhoanThue.Value = "";
            this.AdvTaiKhoanThue.WithCode = 80;
            this.AdvTaiKhoanChu.Conditions = "";
            this.AdvTaiKhoanChu.DefaultValue = "131";
            this.AdvTaiKhoanChu.FieldNameFilter = "Left(SoTaiKhoan,3)";
            this.AdvTaiKhoanChu.KeyFilter = "131";
            point = new Point(0x1ff, 0x5f);
            this.AdvTaiKhoanChu.Location = point;
            padding = new Padding(0);
            this.AdvTaiKhoanChu.Margin = padding;
            this.AdvTaiKhoanChu.Name = "AdvTaiKhoanChu";
            this.AdvTaiKhoanChu.OnlyDigit = false;
            this.AdvTaiKhoanChu.ReadOnly = false;
            size = new Size(0x15f, 20);
            this.AdvTaiKhoanChu.Size = size;
            this.AdvTaiKhoanChu.TabIndex = 0x22;
            this.AdvTaiKhoanChu.UpperText = true;
            this.AdvTaiKhoanChu.Value = "";
            this.AdvTaiKhoanChu.WithCode = 80;
            this.AdvGiaoNhan.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            point = new Point(0x65, 0x74);
            this.AdvGiaoNhan.Location = point;
            this.AdvGiaoNhan.Name = "AdvGiaoNhan";
            this.AdvGiaoNhan.ReadOnly = false;
            size = new Size(0x12f, 20);
            this.AdvGiaoNhan.Size = size;
            this.AdvGiaoNhan.TabIndex = 0x11;
            this.AdvGiaoNhan.UpperText = true;
            this.AdvGiaoNhan.Value = "";
            this.AdvGiaoNhan.WidthCode = 80;
            this.AdvNhanVien.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            point = new Point(0x65, 0x5e);
            this.AdvNhanVien.Location = point;
            this.AdvNhanVien.Name = "AdvNhanVien";
            this.AdvNhanVien.ReadOnly = false;
            size = new Size(0x12f, 20);
            this.AdvNhanVien.Size = size;
            this.AdvNhanVien.TabIndex = 15;
            this.AdvNhanVien.UpperText = true;
            this.AdvNhanVien.Value = "";
            this.AdvNhanVien.WidthCode = 80;
            this.VSHangHoa.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSHangHoa.ColumnInfo = manager.GetString("VSHangHoa.ColumnInfo");
            this.VSHangHoa.Dock = DockStyle.Fill;
            this.VSHangHoa.ExtendLastCol = true;
            this.VSHangHoa.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0);
            this.VSHangHoa.Location = point;
            padding = new Padding(0);
            this.VSHangHoa.Margin = padding;
            this.VSHangHoa.Name = "VSHangHoa";
            this.VSHangHoa.Rows.Count = 1;
            this.VSHangHoa.Rows.DefaultSize = 0x11;
            size = new Size(0x376, 0x159);
            this.VSHangHoa.Size = size;
            this.VSHangHoa.StyleInfo = manager.GetString("VSHangHoa.StyleInfo");
            this.VSHangHoa.TabIndex = 0x11;
            this.VSHangHoa.Tag = "BH-0000";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x260);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.Panel4);
            this.Controls.Add(this.TabControl2);
            this.Controls.Add(this.TabControl1);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_HoaDonChiNhanh";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BH-0011";
            this.Text = "HOA DON BAN HANG TAI CHI NHANH";
            this.TabControl1.ResumeLayout(false);
            this.TabPage1.ResumeLayout(false);
            this.TabPage1.PerformLayout();
            ((ISupportInitialize) this.TxtSoNgayThanhToan).EndInit();
            this.GroupBox1.ResumeLayout(false);
            this.GroupBox1.PerformLayout();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            ((ISupportInitialize) this.TxtSoDuNo).EndInit();
            this.Panel4.ResumeLayout(false);
            this.Panel4.PerformLayout();
            this.GroupBox2.ResumeLayout(false);
            this.GroupBox2.PerformLayout();
            ((ISupportInitialize) this.TxtGioiHanNo).EndInit();
            this.Panel5.ResumeLayout(false);
            this.Panel5.PerformLayout();
            ((ISupportInitialize) this.TxtTyLeChietKhau).EndInit();
            ((ISupportInitialize) this.TxtThueSuat).EndInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).EndInit();
            ((ISupportInitialize) this.TxtTongThanhToan).EndInit();
            ((ISupportInitialize) this.TxtTienThueNT).EndInit();
            ((ISupportInitialize) this.TxtTienHangNT).EndInit();
            ((ISupportInitialize) this.TxtChietKhauNT).EndInit();
            ((ISupportInitialize) this.TxtTienThue).EndInit();
            ((ISupportInitialize) this.TxtTienHang).EndInit();
            ((ISupportInitialize) this.TxtChietKhau).EndInit();
            this.mnChungTuGoc.ResumeLayout(false);
            this.VSDichVu.EndInit();
            this.TabPage2.ResumeLayout(false);
            this.TabControl2.ResumeLayout(false);
            this.TabPage4.ResumeLayout(false);
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.VSHangHoa.EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void LoadCongNo()
        {
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            tuong.Load(Conversions.ToString(this.CboChiNhanh.SelectedValue));
            double num = tuong.GetSoDuCongNo(Conversions.ToString(this.CboChiNhanh.SelectedValue), LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), "NO", modGeneral.H_CLIENT, "131");
            this.TxtSoDuNo.Value = num;
            this.TxtGioiHanNo.Value = tuong.GioiHanNo;
        }

        public void LoadDetailsHangHoa(string pKhoa)
        {
            DataTable listDetails = this.objHD.GetListDetails(pKhoa);
            if ((listDetails != null) && (listDetails.Rows.Count != 0))
            {
                this.VSHangHoa.Rows.Count = 1;
                this.CboKhoHang.SelectedValue = RuntimeHelpers.GetObjectValue(listDetails.Rows[0]["KhoaKho"]);
                int num2 = listDetails.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                    vSHangHoa.AddItem("");
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Khoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoSeriHoaDon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoHoaDon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["NgayHoaDon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Ma"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["HangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoSeri"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["NgayNhap"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["HanSuDung"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaDonViTinh"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["DonViTinh"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["QuyCach"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoLuong"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["GiaVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["GiaBanNT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienBanNT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TyLeChietKhau"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x13] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienChietKhauNT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 20] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaLoaiHoaDon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x15] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["MaLoaiHoaDon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x16] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TyLeThue"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x17] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienThueNT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x18] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaTKHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x19] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TaiKhoanHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x1a] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaTKGiaVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x1b] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TaiKhoanGiaVon"]);
                    vSHangHoa = null;
                }
            }
        }

        private void mnBaoGia_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_BaoGiaList.Dispose();
            MyProject.Forms.Frm_BaoGiaList.objFrmCall = this;
            MyProject.Forms.Frm_BaoGiaList.strConditions = " ( BG.TinhTrang = 0 or BG.TinhTrang = 1 ) And Rtrim(IsNull(BG.KhoaHoaDon,'')) = '' ";
            MyProject.Forms.Frm_BaoGiaList.ShowDialog();
        }

        public bool SaveDVDetailsTemp()
        {
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            clsHoaDonChiTietDichVu objHDDV = this.objHDDV;
            int num3 = this.VSDichVu.Rows.Count - 1;
            for (int i = 1; i <= num3; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        this.VSDichVu[i, 0] = modGeneral.CreatKey("ST_XuatKhoChiTiet", 15, "");
                    }
                    objHDDV.Khoa = this.VSDichVu[i, 0].ToString().Trim();
                    objHDDV.KhoaPhieuXuat = this.cFrmKhoa;
                    objHDDV.KhoaDichVu = this.VSDichVu[i, 1].ToString().Trim();
                    objHDDV.SoLuong = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 4]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDDV.DonGiaNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 5]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDDV.DonGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 5]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDDV.TienBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 6]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDDV.TienBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 6]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDDV.TyLeChietKhau = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 7]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDDV.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 8]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDDV.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 8]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDDV.TyLeThue = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 9]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDDV.TienThueNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 10]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDDV.TienThue = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSDichVu[i, 10]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    if (!objHDDV.Save())
                    {
                        return false;
                    }
                }
            }
            objHDDV = null;
            return true;
        }

        public bool SaveHHDetailsTemp()
        {
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            clsXuatKhoChiTiet objHDHH = this.objHDHH;
            int num3 = this.VSHangHoa.Rows.Count - 1;
            for (int i = 1; i <= num3; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 4]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        this.VSHangHoa[i, 0] = modGeneral.CreatKey("ST_XuatKhoChiTiet", 15, "");
                    }
                    objHDHH.Khoa = this.VSHangHoa[i, 0].ToString().Trim();
                    objHDHH.NamThang = LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6);
                    objHDHH.KhoaPhieuXuat = this.cFrmKhoa;
                    objHDHH.NgayBan = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
                    objHDHH.KhoaHangHoa = this.VSHangHoa[i, 4].ToString().Trim();
                    objHDHH.KhoaKho = Conversions.ToString(this.CboKhoHang.SelectedValue);
                    objHDHH.KhoaQuayKe = "";
                    objHDHH.SoLoHang = "";
                    objHDHH.NgayNhap = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 8]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objHDHH.HanSuDung = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 9]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objHDHH.SoSeri = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 7]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objHDHH.SoLuong = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 13]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.GiaVonNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 14]), 0, modGeneral.TypeOfValue.Nothing)) / num2;
                    objHDHH.GiaVon = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 14]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienVonNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 15]), 0, modGeneral.TypeOfValue.Nothing)) / num2;
                    objHDHH.TienVon = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.GiaBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.GiaBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDHH.TienBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDHH.TyLeThue = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x16]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienThueNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x17]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienThue = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x17]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDHH.TyLeChietKhau = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x13]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDHH.KhoaDonViTinh = this.VSHangHoa[i, 10].ToString().Trim();
                    objHDHH.QuyCach = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.KhoaTKHangHoa = this.VSHangHoa[i, 0x18].ToString().Trim();
                    objHDHH.KhoaTKGiaVon = this.VSHangHoa[i, 0x1a].ToString().Trim();
                    if (!objHDHH.Save())
                    {
                        return false;
                    }
                }
            }
            objHDHH = null;
            return true;
        }

        public void ShowData(string pKhoa)
        {
            if (this.objHD.Load(pKhoa))
            {
                clsXuatKho objHD = this.objHD;
                this.cFrmKhoa = objHD.Khoa;
                this.TxtSoChungTu.Text = objHD.SoChungTu;
                this.TxtNgayChungTu.Text = LVYModule.Char2Date(objHD.NgayChungTu);
                this.CboChiNhanh.SelectedValue = objHD.KhoaDoiTuong;
                this.CboLoaiTien.SelectedValue = objHD.LoaiTien;
                this.txtTyGia.Value = objHD.TyGia;
                this.CboLoaiHoaDon.SelectedValue = objHD.KhoaLoaiHoaDon;
                this.TxtThueSuat.Value = objHD.ThueSuat;
                this.TxtSoHoaDon.Text = objHD.SoHoaDon;
                this.TxtNgayHoaDon.Text = LVYModule.Char2Date(objHD.NgayHoaDon);
                this.TxtSoSeri.Text = objHD.SoSeri;
                this.TxtTienHangNT.Value = objHD.TienHangNT;
                this.TxtTienHang.Value = objHD.TienHang;
                this.TxtChietKhauNT.Value = objHD.TienChietKhauNT;
                this.TxtChietKhau.Value = objHD.TienChietKhau;
                this.TxtTienThueNT.Value = objHD.TienThueVATNT;
                this.TxtTienThue.Value = objHD.TienThueVAT;
                this.TxtTongThanhToanNT.Value = (objHD.TienHangNT - objHD.TienChietKhauNT) + objHD.TienThueVATNT;
                this.TxtTongThanhToan.Value = (objHD.TienHang - objHD.TienChietKhau) + objHD.TienThueVAT;
                this.AdvTaiKhoanChu.Value = objHD.KhoaTKThanhToan;
                this.AdvTaiKhoanThue.Value = objHD.KhoaTKThue;
                this.AdvTKDoanhThu.Value = objHD.KhoaTKDoanhThu;
                this.AdvTKChietKhau.Value = objHD.KhoaTKChietKhau;
                this.TxtDienGiai.Text = objHD.DienGiai;
                this.TxtSoNgayThanhToan.Value = objHD.HanThanhToan;
                this.TxtNgayToiHanThanhToan.Text = LVYModule.Char2Date(objHD.NgayThanhToan);
                this.cFrmGhiSo = objHD.GhiSo;
                this.CboLoaiGia.SelectedValue = objHD.KhoaLoaiGia;
                this.AdvNhanVien.Value = objHD.KhoaNhanVienBanHang;
                this.AdvGiaoNhan.Value = objHD.KhoaNhanVienGiaoHang;
                this.TxtTenDoiTuongThue.Text = objHD.TenDoiTuongThue;
                this.TxtMaSoThue.Text = objHD.MaSoThue;
                this.TxtDiaChiThue.Text = objHD.DiaChiThue;
                this.TxtTyLeChietKhau.Value = objHD.TyLeChietKhau;
                if (objHD.CachTinhChietKhau == "HD")
                {
                    this.CKChietKhauTheoHD.CheckState = CheckState.Checked;
                }
                else
                {
                    this.CKChietKhauTheoHD.CheckState = CheckState.Unchecked;
                }
                this.LoadDetailsHangHoa(this.cFrmKhoa);
                objHD = null;
            }
        }

        public void TimHangDanhMuc(int nRow, int nCol)
        {
            double num3 = 0.0;
            string pValue = "";
            num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            if (num3 == 0.0)
            {
                num3 = 1.0;
            }
            pValue = SearchModule.SearchHangHoa(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[nRow, nCol]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboKhoHang.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim(), "");
            if (LVYModule.ReturnIfNull(pValue, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                object instance = Strings.Split(pValue, "|", -1, CompareMethod.Binary);
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null)), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
                {
                    this.objHH.Load(Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null)));
                    this.objHH.LoadGiaBan(Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null)), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiGia.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), "VIET");
                    this.pdt = this.objHH.GetHangHoa(Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null)));
                    this.objDVT.Load(this.objHH.KhoaDonViTinh);
                    C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                    vSHangHoa[nRow, 4] = this.objHH.Khoa;
                    vSHangHoa[nRow, 5] = this.objHH.Ma;
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        vSHangHoa[nRow, 6] = this.objHH.TenViet;
                        vSHangHoa[nRow, 11] = this.objDVT.TenViet;
                    }
                    else
                    {
                        vSHangHoa[nRow, 6] = this.objHH.TenAnh;
                        vSHangHoa[nRow, 11] = this.objDVT.TenAnh;
                    }
                    vSHangHoa[nRow, 7] = "";
                    vSHangHoa[nRow, 8] = "";
                    vSHangHoa[nRow, 10] = this.objHH.KhoaDonViTinh;
                    vSHangHoa[nRow, 12] = 1;
                    vSHangHoa[nRow, 13] = 1;
                    vSHangHoa[nRow, 14] = 0;
                    vSHangHoa[nRow, 15] = 0;
                    if (modGeneral.H_GIABANBAOGOMTHUE & (this.TxtSoSeri.Text.Trim() != ""))
                    {
                        vSHangHoa[nRow, 0x16] = this.objHH.TyLeThue;
                        double tyLeThue = this.objHH.TyLeThue;
                        double giaBan = this.objHH.GiaBan;
                        giaBan -= Math.Round((double) (giaBan / (100.0 + tyLeThue)), 0) * tyLeThue;
                        vSHangHoa[nRow, 0x10] = Math.Round((double) (giaBan / num3), this.ObjLT.SoLe);
                        vSHangHoa[nRow, 0x11] = Math.Round((double) (giaBan / num3), this.ObjLT.SoLe);
                        if (this.objLHD.LoadByRateAndType((int) Math.Round(tyLeThue), "V", "BR"))
                        {
                            vSHangHoa[nRow, 20] = this.objLHD.Khoa;
                            vSHangHoa[nRow, 0x15] = this.objLHD.Ma;
                        }
                        vSHangHoa[nRow, 0x17] = this.objHH.GiaBan - giaBan;
                    }
                    else
                    {
                        vSHangHoa[nRow, 0x10] = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(this.objHH.GiaBan, 0, modGeneral.TypeOfValue.Nothing)) / num3), this.ObjLT.SoLe);
                        vSHangHoa[nRow, 0x11] = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(this.objHH.GiaBan, 0, modGeneral.TypeOfValue.Nothing)) / num3), this.ObjLT.SoLe);
                    }
                    vSHangHoa[nRow, 0x18] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["KhoaTKHangHoa"]);
                    vSHangHoa[nRow, 0x19] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["TaiKhoanHangHoa"]);
                    vSHangHoa[nRow, 0x1a] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["KhoaTKGiaVon"]);
                    vSHangHoa[nRow, 0x1b] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["TaiKhoanGiaVon"]);
                    vSHangHoa.Select(nRow, 13);
                    vSHangHoa = null;
                }
            }
        }

        public void TinhChietKhau(int nRow)
        {
            double num = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            int num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
            vSHangHoa[nRow, 0x13] = Math.Round((double) ((num2 * num) / 100.0), 0);
            vSHangHoa = null;
        }

        public void TinhGiaBan(int nRow)
        {
            string pKhoaLoaiGia = Conversions.ToString(this.CboLoaiGia.SelectedValue);
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            double num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 12]), 1, modGeneral.TypeOfValue.Nothing));
            this.objHH.LoadGiaBan(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 3]), "", modGeneral.TypeOfValue.Nothing)), pKhoaLoaiGia, "VIET");
            vSHangHoa[nRow, 0x10] = num * this.objHH.GiaBan;
            vSHangHoa = null;
        }

        private void TinhThue(int nRow)
        {
            double num = 0.0;
            string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
            if (strCode != "")
            {
                this.ObjLT.LoadByCode(strCode);
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                int num3 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x16]), 0, modGeneral.TypeOfValue.Nothing));
                num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x11]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
                vSHangHoa[nRow, 0x17] = Math.Round((double) ((num3 * num) / 100.0), this.ObjLT.SoLe);
                vSHangHoa = null;
            }
        }

        public void TinhTienBan(int nRow)
        {
            double num = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            vSHangHoa[nRow, 0x11] = Math.Round((double) (num * num2), Conversions.ToInteger(LVYModule.ReturnIfNull(this.ObjLT.SoLe, 0, modGeneral.TypeOfValue.Nothing)));
            vSHangHoa = null;
        }

        public void TinhTienVon(int nRow)
        {
            double num = 0.0;
            double num3 = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 14]), 0, modGeneral.TypeOfValue.Nothing));
            num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 12]), 1, modGeneral.TypeOfValue.Nothing));
            vSHangHoa[nRow, 15] = (num * num3) * num2;
            vSHangHoa = null;
        }

        public void TinhTong()
        {
            double num = 0.0;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            if (this.CKChietKhauTheoHD.CheckState != CheckState.Checked)
            {
                this.TxtTienHangNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 0x11) + LVYModule.SumColGrid(this.VSDichVu, 6);
                this.TxtChietKhauNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 0x13) + LVYModule.SumColGrid(this.VSDichVu, 8);
                this.TxtTienThueNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 0x17) + LVYModule.SumColGrid(this.VSDichVu, 10);
                this.TxtTongThanhToanNT.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                this.TxtTienHang.Value = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num), 0);
                this.TxtChietKhau.Value = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num), 0);
                this.TxtTienThue.Value = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num), 0);
                this.TxtTongThanhToan.Value = Math.Round((double) (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num), 0);
            }
        }

        public void TinhTongChietKhau()
        {
            double num2 = 0.0;
            int num3 = 0;
            double num = 0.0;
            num3 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyLeChietKhau.Value), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtChietKhauNT.Value = Math.Round((double) ((num3 * num) / 100.0), 0);
            this.TxtChietKhau.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num2;
        }

        public void TinhTongThanhToan()
        {
            double num = 0.0;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTongThanhToanNT.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTongThanhToan.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTongThanhToanNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
        }

        public void TinhTongThue()
        {
            double num3 = 0.0;
            int num4 = 0;
            double num2 = 0.0;
            double num = 0.0;
            num4 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value), 0, modGeneral.TypeOfValue.Nothing));
            num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            num2 -= num;
            this.TxtTienThueNT.Value = Math.Round((double) ((num2 * num4) / 100.0), 0);
            this.TxtTienThue.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num3;
        }

        public void TinhTongTienHang()
        {
            double num = 0.0;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTienHangNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 0x11) + LVYModule.SumColGrid(this.VSDichVu, 8);
            this.TxtTienHang.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
        }

        private void TxtChietKhauNT_LostFocus(object sender, EventArgs e)
        {
            if (!this.TxtChietKhauNT.ReadOnly)
            {
                double num2 = 0.0;
                double num = 0.0;
                double num3 = 0.0;
                num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
                num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                if (num == 0.0)
                {
                    this.TxtTyLeChietKhau.Value = 0;
                }
                else
                {
                    this.TxtTyLeChietKhau.Value = Math.Round((double) ((num * 100.0) / num2), 0);
                }
                this.TxtChietKhau.Value = num * num3;
                this.TinhTongThue();
                this.TinhTongThanhToan();
            }
        }

        private void TxtChietKhauNT_TextChanged(object sender, EventArgs e)
        {
        }

        private void TxtNgayChungTu_LostFocus(object sender, EventArgs e)
        {
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.TxtNgayHoaDon.Text = this.TxtNgayChungTu.Text;
        }

        private void TxtSoHoaDon_LostFocus(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboChiNhanh.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
            {
                clsDMDoiTuong tuong = new clsDMDoiTuong();
                tuong.Load(Conversions.ToString(this.CboChiNhanh.SelectedValue));
                if (modGeneral.H_LANGUAGE == "VIET")
                {
                    this.TxtDienGiai.Text = modGeneral.Tranlated("Xuất b\x00e1n cho", "") + " " + tuong.TenViet.Trim();
                }
                else
                {
                    this.TxtDienGiai.Text = modGeneral.Tranlated("Xuất b\x00e1n cho", "") + " " + tuong.TenAnh.Trim();
                }
            }
        }

        private void TxtSoNgayThanhToan_LostFocus(object sender, EventArgs e)
        {
            double number = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoNgayThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing));
            if (number == 0.0)
            {
                this.TxtNgayToiHanThanhToan.Text = this.TxtNgayChungTu.Text;
            }
            else
            {
                this.TxtNgayToiHanThanhToan.Text = Strings.Format(DateAndTime.DateAdd(DateInterval.Day, number, Conversions.ToDate(this.TxtNgayChungTu.Text)), "dd/MM/yyyy");
            }
        }

        private void TxtSoSeri_LostFocus(object sender, EventArgs e)
        {
            this.GetGiaBanCoThue();
        }

        private void TxtThueSuat_LostFocus(object sender, EventArgs e)
        {
            this.TinhTongThue();
            this.TinhTongThanhToan();
        }

        private void TxtTienThueNT_LostFocus(object sender, EventArgs e)
        {
            this.TinhTongThanhToan();
        }

        private void txtTyGia_LostFocus(object sender, EventArgs e)
        {
            int num2 = this.VSHangHoa.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                RowColEventArgs args = new RowColEventArgs(i, 0x10);
                this.VSHangHoa_AfterEdit(this.VSHangHoa, args);
            }
        }

        private void TxtTyLeChietKhau_LostFocus(object sender, EventArgs e)
        {
            this.TinhTongChietKhau();
            this.TinhTongThue();
            this.TinhTongThanhToan();
        }

        public object UpdateData()
        {
            object obj2;
            clsXuatKho objHD = this.objHD;
            objHD.Khoa = this.cFrmKhoa;
            objHD.SoChungTu = this.TxtSoChungTu.Text.Trim();
            objHD.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objHD.KhoaDoiTuong = Conversions.ToString(this.CboChiNhanh.SelectedValue);
            objHD.NguoiGiao = "";
            objHD.KhoaBoPhan = "";
            objHD.KhoaSanPham = "";
            objHD.KhoaHopDong = "";
            objHD.LoaiTien = this.CboLoaiTien.SelectedValue.ToString().Trim();
            objHD.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            objHD.KhoaLoaiHoaDon = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiHoaDon.SelectedValue), "", modGeneral.TypeOfValue.String).ToString();
            objHD.ThueSuat = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.SoHoaDon = this.TxtSoHoaDon.Text.ToString().Trim();
            objHD.NgayHoaDon = LVYModule.Date2Char(this.TxtNgayHoaDon.Text.ToString().Trim());
            objHD.SoSeri = this.TxtSoSeri.Text.ToString().Trim();
            objHD.TienHangNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.TienHang = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHang.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhau.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.TienThueVATNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.TienThueVAT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThue.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.KhoaTKThanhToan = LVYModule.ReturnIfNull(this.AdvTaiKhoanChu.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objHD.KhoaTKThue = LVYModule.ReturnIfNull(this.AdvTaiKhoanThue.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objHD.KhoaTKDoanhThu = LVYModule.ReturnIfNull(this.AdvTKDoanhThu.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objHD.KhoaTKChietKhau = LVYModule.ReturnIfNull(this.AdvTKChietKhau.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objHD.DienGiai = this.TxtDienGiai.Text.ToString().Trim();
            objHD.HanThanhToan = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoNgayThanhToan.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.NgayThanhToan = LVYModule.Date2Char(this.TxtNgayToiHanThanhToan.Text);
            objHD.DaThanhToanNT = 0.0;
            objHD.DaThanhToan = 0.0;
            objHD.LoaiChungTu = "XB";
            objHD.KhoaNhanVienBanHang = this.AdvNhanVien.Value;
            objHD.KhoaLoaiGia = Conversions.ToString(this.CboLoaiGia.SelectedValue);
            objHD.KhoaNhanVienTao = modGeneral.H_USERID;
            objHD.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objHD.KhoaNhanVienSua = modGeneral.H_USERID;
            objHD.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objHD.GhiSo = 1;
            objHD.KhoaDonVi = modGeneral.H_CLIENT;
            objHD.Send = 0;
            objHD.KhoaNhanVienGiaoHang = this.AdvGiaoNhan.Value;
            objHD.TenDoiTuongThue = this.TxtTenDoiTuongThue.Text;
            objHD.MaSoThue = this.TxtMaSoThue.Text;
            objHD.DiaChiThue = this.TxtDiaChiThue.Text;
            objHD.TyLeChietKhau = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyLeChietKhau.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.LoaiBanHang = "CN";
            if (this.CKChietKhauTheoHD.CheckState == CheckState.Checked)
            {
                objHD.CachTinhChietKhau = "HD";
            }
            else
            {
                objHD.CachTinhChietKhau = "HH";
            }
            return objHD.Save();
            objHD = null;
            return obj2;
        }

        private void VSHangHoa_AfterEdit(object sender, RowColEventArgs e)
        {
            double num2 = 0.0;
            bool flag = true;
            int num = 0;
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                num2 = 1.0;
            }
            switch (e.Col)
            {
                case 2:
                case 3:
                {
                    string pKhoa = "";
                    RowColEventArgs args = new RowColEventArgs(e.Row, 0x10);
                    pKhoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 4]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                    if (pKhoa.Trim() != "")
                    {
                        this.objHH.Load(pKhoa);
                        this.objHH.LoadGiaBan(pKhoa, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiGia.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim(), "VIET");
                        double a = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 0x16]), 0, modGeneral.TypeOfValue.Nothing));
                        if (this.objLHD.LoadByRateAndType((int) Math.Round(a), "V", "BR"))
                        {
                            this.VSHangHoa[e.Row, 20] = this.objLHD.Khoa;
                            this.VSHangHoa[e.Row, 0x15] = this.objLHD.Ma;
                        }
                        if (e.Row < (this.VSHangHoa.Rows.Count - 1))
                        {
                            int num5 = this.VSHangHoa.Rows.Count - 1;
                            for (num = e.Row + 1; num <= num5; num++)
                            {
                                if (a == Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[num, 0x16]), 0, modGeneral.TypeOfValue.Nothing)))
                                {
                                    this.VSHangHoa[num, 1] = RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 1]);
                                    this.VSHangHoa[num, 2] = RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 2]);
                                    this.VSHangHoa[num, 3] = RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 3]);
                                }
                            }
                        }
                        goto Label_0556;
                    }
                    return;
                }
                case 5:
                    if (e.Row != 1)
                    {
                        flag = true;
                        break;
                    }
                    flag = false;
                    break;

                case 11:
                case 12:
                    this.TinhGiaBan(e.Row);
                    this.TinhTienVon(e.Row);
                    if (this.CKChietKhauTheoHD.CheckState != CheckState.Checked)
                    {
                        this.TinhTienBan(e.Row);
                        this.TinhChietKhau(e.Row);
                        this.TinhThue(e.Row);
                    }
                    else
                    {
                        this.TinhTongTienHang();
                        this.TinhTongChietKhau();
                        this.TinhTongThue();
                        this.TinhTongThanhToan();
                    }
                    goto Label_0556;

                case 13:
                    this.TinhTienVon(e.Row);
                    this.TinhTienBan(e.Row);
                    if (this.CKChietKhauTheoHD.CheckState != CheckState.Checked)
                    {
                        this.TinhTienBan(e.Row);
                        this.TinhChietKhau(e.Row);
                        this.TinhThue(e.Row);
                    }
                    else
                    {
                        this.TinhTongTienHang();
                        this.TinhTongChietKhau();
                        this.TinhTongThue();
                        this.TinhTongThanhToan();
                    }
                    goto Label_0556;

                case 0x10:
                    this.TinhTienBan(e.Row);
                    if (this.CKChietKhauTheoHD.CheckState != CheckState.Checked)
                    {
                        this.TinhChietKhau(e.Row);
                        this.TinhThue(e.Row);
                    }
                    else
                    {
                        this.TinhTongTienHang();
                        this.TinhTongChietKhau();
                        this.TinhTongThue();
                        this.TinhTongThanhToan();
                    }
                    goto Label_0556;

                case 0x12:
                    if (this.CKChietKhauTheoHD.CheckState != CheckState.Checked)
                    {
                        this.TinhChietKhau(e.Row);
                        this.TinhThue(e.Row);
                    }
                    else
                    {
                        this.TinhTongChietKhau();
                        this.TinhTongThue();
                        this.TinhTongThanhToan();
                    }
                    goto Label_0556;

                case 0x13:
                    if (this.CKChietKhauTheoHD.CheckState != CheckState.Checked)
                    {
                        this.TinhThue(e.Row);
                    }
                    else
                    {
                        this.TinhTongThue();
                        this.TinhTongThanhToan();
                    }
                    goto Label_0556;

                case 20:
                    if (this.CKChietKhauTheoHD.CheckState != CheckState.Checked)
                    {
                        this.TinhThue(e.Row);
                    }
                    else
                    {
                        this.TinhTongThue();
                        this.TinhTongThanhToan();
                    }
                    goto Label_0556;

                default:
                    goto Label_0556;
            }
            this.TimHangDanhMuc(e.Row, e.Col);
            this.TinhTong();
        Label_0556:
            this.TinhTong();
        }

        private void VSHangHoa_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if (((((e.Col == 0x12) | (e.Col == 0x13)) | (e.Col == 0x15)) | (e.Col == 0x16)) && (this.CKChietKhauTheoHD.CheckState == CheckState.Checked))
            {
                e.Cancel = true;
            }
        }

        private void VSHangHoa_CellButtonClick(object sender, RowColEventArgs e)
        {
            if (e.Col == 11)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                object instance = SearchModule.SearchDVT(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[e.Row, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), this.VSHangHoa, e.Row, e.Col, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[e.Row, 10]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                if (instance != null)
                {
                    if (Information.UBound((Array) instance, 1) >= 2)
                    {
                        vSHangHoa[e.Row, 10] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                        vSHangHoa[e.Row, 11] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
                        vSHangHoa[e.Row, 12] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 2 }, null));
                        this.VSHangHoa_AfterEdit(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                    vSHangHoa.Select(e.Row, 13);
                    vSHangHoa = null;
                }
            }
        }

        internal virtual ADVObjects AdvGiaoNhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvGiaoNhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvGiaoNhan = value;
            }
        }

        internal virtual ADVObjects AdvNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvNhanVien = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanChu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanChu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanChu = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanThue = value;
            }
        }

        internal virtual ADVAccount AdvTKChietKhau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKChietKhau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKChietKhau = value;
            }
        }

        internal virtual ADVAccount AdvTKDoanhThu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTKDoanhThu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTKDoanhThu = value;
            }
        }

        internal virtual Button Button2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Button2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.Button2_Click);
                if (this._Button2 != null)
                {
                    this._Button2.Click -= handler;
                }
                this._Button2 = value;
                if (this._Button2 != null)
                {
                    this._Button2.Click += handler;
                }
            }
        }

        internal virtual ComboBox CboChiNhanh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboChiNhanh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboChiNhanh = value;
            }
        }

        internal virtual ComboBox CboKhoHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboKhoHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboKhoHang = value;
            }
        }

        internal virtual ComboBox CboLoaiGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiGia = value;
            }
        }

        internal virtual ComboBox CboLoaiHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiHoaDon_SelectedIndexChanged);
                if (this._CboLoaiHoaDon != null)
                {
                    this._CboLoaiHoaDon.SelectedIndexChanged -= handler;
                }
                this._CboLoaiHoaDon = value;
                if (this._CboLoaiHoaDon != null)
                {
                    this._CboLoaiHoaDon.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKChietKhauTheoHD
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKChietKhauTheoHD;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKChietKhauTheoHD_CheckedChanged);
                if (this._CKChietKhauTheoHD != null)
                {
                    this._CKChietKhauTheoHD.CheckedChanged -= handler;
                }
                this._CKChietKhauTheoHD = value;
                if (this._CKChietKhauTheoHD != null)
                {
                    this._CKChietKhauTheoHD.CheckedChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKHienThiHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKHienThiHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKHienThiHoaDon_CheckedChanged);
                if (this._CKHienThiHoaDon != null)
                {
                    this._CKHienThiHoaDon.CheckedChanged -= handler;
                }
                this._CKHienThiHoaDon = value;
                if (this._CKHienThiHoaDon != null)
                {
                    this._CKHienThiHoaDon.CheckedChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKTachThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKTachThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKTachThue = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdCongNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCongNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCongNo_Click);
                if (this._CmdCongNo != null)
                {
                    this._CmdCongNo.Click -= handler;
                }
                this._CmdCongNo = value;
                if (this._CmdCongNo != null)
                {
                    this._CmdCongNo.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDelRow_Click);
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click -= handler;
                }
                this._CmdDelRow = value;
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click += handler;
                }
            }
        }

        internal virtual Button CmdDTThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDTThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.Button3_Click);
                if (this._CmdDTThue != null)
                {
                    this._CmdDTThue.Click -= handler;
                }
                this._CmdDTThue = value;
                if (this._CmdDTThue != null)
                {
                    this._CmdDTThue.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdHoaHong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHoaHong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdHoaHong_Click);
                if (this._CmdHoaHong != null)
                {
                    this._CmdHoaHong.Click -= handler;
                }
                this._CmdHoaHong = value;
                if (this._CmdHoaHong != null)
                {
                    this._CmdHoaHong.Click += handler;
                }
            }
        }

        internal virtual ToolStripMenuItem cmdPhieuXuat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmdPhieuXuat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmdPhieuXuat_Click);
                if (this._cmdPhieuXuat != null)
                {
                    this._cmdPhieuXuat.Click -= handler;
                }
                this._cmdPhieuXuat = value;
                if (this._cmdPhieuXuat != null)
                {
                    this._cmdPhieuXuat.Click += handler;
                }
            }
        }

        internal virtual ToolStripSplitButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_ButtonClick);
                EventHandler handler2 = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.ButtonClick -= handler;
                    this._CmdPrint.Click -= handler2;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.ButtonClick += handler;
                    this._CmdPrint.Click += handler2;
                }
            }
        }

        internal virtual ToolStripMenuItem cmdPrintVATMau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmdPrintVATMau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmdPrintVATMau_Click);
                if (this._cmdPrintVATMau != null)
                {
                    this._cmdPrintVATMau.Click -= handler;
                }
                this._cmdPrintVATMau = value;
                if (this._cmdPrintVATMau != null)
                {
                    this._cmdPrintVATMau.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdAddRow.Enabled = value;
                this.CmdDelRow.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtSoSeri.ReadOnly = !value;
                this.TxtThueSuat.ReadOnly = !value;
                this.CboChiNhanh.Enabled = value;
                this.AdvTaiKhoanChu.ReadOnly = !value;
                this.AdvTaiKhoanThue.ReadOnly = !value;
                this.TxtSoNgayThanhToan.ReadOnly = !value;
                this.TxtNgayToiHanThanhToan.Enabled = value;
                this.AdvTKDoanhThu.ReadOnly = !value;
                this.AdvTKChietKhau.ReadOnly = !value;
                this.AdvNhanVien.ReadOnly = !value;
                this.CboLoaiGia.Enabled = value;
                this.CmdHoaHong.Enabled = !value;
                this.AdvGiaoNhan.ReadOnly = !value;
                this.CKTachThue.Enabled = value;
                this.CKChietKhauTheoHD.Enabled = value;
                this.CmdDTThue.Enabled = value;
                this.CboKhoHang.Enabled = value;
                if (value)
                {
                    this.TxtTyLeChietKhau.ReadOnly = this.CKChietKhauTheoHD.CheckState != CheckState.Checked;
                    this.TxtChietKhauNT.ReadOnly = this.CKChietKhauTheoHD.CheckState != CheckState.Checked;
                }
                else
                {
                    this.TxtTyLeChietKhau.ReadOnly = true;
                    this.TxtChietKhauNT.ReadOnly = true;
                }
            }
        }

        internal virtual GroupBox GroupBox1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox1 = value;
            }
        }

        internal virtual GroupBox GroupBox2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox2 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label21
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label21;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label21 = value;
            }
        }

        internal virtual Label Label22
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label22;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label22 = value;
            }
        }

        internal virtual Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Label Label24
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label24;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label24 = value;
            }
        }

        internal virtual Label Label25
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label25;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label25 = value;
            }
        }

        internal virtual Label Label26
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label26;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label26 = value;
            }
        }

        internal virtual Label Label27
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label27;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label27 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label30
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label30;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label30 = value;
            }
        }

        internal virtual Label Label31
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label31;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label31 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual ToolStripMenuItem mnBaoGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._mnBaoGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.mnBaoGia_Click);
                if (this._mnBaoGia != null)
                {
                    this._mnBaoGia.Click -= handler;
                }
                this._mnBaoGia = value;
                if (this._mnBaoGia != null)
                {
                    this._mnBaoGia.Click += handler;
                }
            }
        }

        internal virtual ContextMenuStrip mnChungTuGoc
        {
            [DebuggerNonUserCode]
            get
            {
                return this._mnChungTuGoc;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._mnChungTuGoc = value;
            }
        }

        internal virtual ToolStripMenuItem mnDonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._mnDonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._mnDonHang = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual TabControl TabControl1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl1 = value;
            }
        }

        internal virtual TabControl TabControl2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabControl2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabControl2 = value;
            }
        }

        internal virtual TabPage TabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage1 = value;
            }
        }

        internal virtual TabPage TabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage2 = value;
            }
        }

        internal virtual TabPage TabPage4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TabPage4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TabPage4 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripButton ToolStripButton2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator4 = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtChietKhau = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhauNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhauNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtChietKhauNT_TextChanged);
                EventHandler handler2 = new EventHandler(this.TxtChietKhauNT_LostFocus);
                if (this._TxtChietKhauNT != null)
                {
                    this._TxtChietKhauNT.TextChanged -= handler;
                    this._TxtChietKhauNT.LostFocus -= handler2;
                }
                this._TxtChietKhauNT = value;
                if (this._TxtChietKhauNT != null)
                {
                    this._TxtChietKhauNT.TextChanged += handler;
                    this._TxtChietKhauNT.LostFocus += handler2;
                }
            }
        }

        internal virtual TextBox TxtDiaChiThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDiaChiThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDiaChiThue = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual C1NumericEdit TxtGioiHanNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtGioiHanNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtGioiHanNo = value;
            }
        }

        internal virtual TextBox TxtMaSoThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtMaSoThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtMaSoThue = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtNgayChungTu_LostFocus);
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.LostFocus -= handler;
                }
                this._TxtNgayChungTu = value;
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.LostFocus += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtNgayHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayHoaDon = value;
            }
        }

        internal virtual DateTimePicker TxtNgayToiHanThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayToiHanThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayToiHanThanhToan = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual C1NumericEdit TxtSoDuNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoDuNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoDuNo = value;
            }
        }

        internal virtual TextBox TxtSoHoaDon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHoaDon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoHoaDon_LostFocus);
                if (this._TxtSoHoaDon != null)
                {
                    this._TxtSoHoaDon.LostFocus -= handler;
                }
                this._TxtSoHoaDon = value;
                if (this._TxtSoHoaDon != null)
                {
                    this._TxtSoHoaDon.LostFocus += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtSoNgayThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoNgayThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoNgayThanhToan_LostFocus);
                if (this._TxtSoNgayThanhToan != null)
                {
                    this._TxtSoNgayThanhToan.LostFocus -= handler;
                }
                this._TxtSoNgayThanhToan = value;
                if (this._TxtSoNgayThanhToan != null)
                {
                    this._TxtSoNgayThanhToan.LostFocus += handler;
                }
            }
        }

        internal virtual TextBox TxtSoSeri
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoSeri;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtSoSeri_LostFocus);
                if (this._TxtSoSeri != null)
                {
                    this._TxtSoSeri.LostFocus -= handler;
                }
                this._TxtSoSeri = value;
                if (this._TxtSoSeri != null)
                {
                    this._TxtSoSeri.LostFocus += handler;
                }
            }
        }

        internal virtual TextBox TxtTenDoiTuongThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenDoiTuongThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTenDoiTuongThue = value;
            }
        }

        internal virtual C1NumericEdit TxtThueSuat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtThueSuat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtThueSuat_LostFocus);
                if (this._TxtThueSuat != null)
                {
                    this._TxtThueSuat.LostFocus -= handler;
                }
                this._TxtThueSuat = value;
                if (this._TxtThueSuat != null)
                {
                    this._TxtThueSuat.LostFocus += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTienHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHang = value;
            }
        }

        internal virtual C1NumericEdit TxtTienHangNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHangNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHangNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThue = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThueNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThueNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTienThueNT_LostFocus);
                if (this._TxtTienThueNT != null)
                {
                    this._TxtTienThueNT.LostFocus -= handler;
                }
                this._TxtTienThueNT = value;
                if (this._TxtTienThueNT != null)
                {
                    this._TxtTienThueNT.LostFocus += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtTinhThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTinhThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTinhThue = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToan = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToanNT = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.txtTyGia_LostFocus);
                if (this._txtTyGia != null)
                {
                    this._txtTyGia.LostFocus -= handler;
                }
                this._txtTyGia = value;
                if (this._txtTyGia != null)
                {
                    this._txtTyGia.LostFocus += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTyLeChietKhau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTyLeChietKhau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTyLeChietKhau_LostFocus);
                if (this._TxtTyLeChietKhau != null)
                {
                    this._TxtTyLeChietKhau.LostFocus -= handler;
                }
                this._TxtTyLeChietKhau = value;
                if (this._TxtTyLeChietKhau != null)
                {
                    this._TxtTyLeChietKhau.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSDichVu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSDichVu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSDichVu = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSHangHoa
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSHangHoa;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSHangHoa_BeforeEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSHangHoa_AfterEdit);
                RowColEventHandler handler3 = new RowColEventHandler(this.VSHangHoa_CellButtonClick);
                if (this._VSHangHoa != null)
                {
                    this._VSHangHoa.BeforeEdit -= handler;
                    this._VSHangHoa.AfterEdit -= handler2;
                    this._VSHangHoa.CellButtonClick -= handler3;
                }
                this._VSHangHoa = value;
                if (this._VSHangHoa != null)
                {
                    this._VSHangHoa.BeforeEdit += handler;
                    this._VSHangHoa.AfterEdit += handler2;
                    this._VSHangHoa.CellButtonClick += handler3;
                }
            }
        }
    }
}

